I want to position UI element of the screen, e.g. for creating a HUD. As I understand I need to use container widgets for horizontal or vertical positioning. But there are two ways:
- There are container widgets explained in the wiki: http://www.cocos2d-x.org/wiki/Containers
You can create different layouts using Layout class like this:
layout->setLayoutType(Type::VERTICAL);
layout->setLayoutType(Type::HORIZONTAL);
layout->setLayoutType(Type::RELATIVE);
- But also there are
HBox
,VBox
andRelativeBox
( http://www.cocos2d-x.org/reference/native-cpp/V3.2/dc/d08/classcocos2d_1_1ui_1_1_h_box.html#a4209b8ef063c61adc45869fd937bad95 ). Which of these ways I should use?