Should I use Layouts with setting its type or recomemded is HBox and VBox?

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:

  1. 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);
  1. But also there are HBox, VBox and RelativeBox ( 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?
1 Like

What did you end up finding? I’ve been doing the work manually with Layouts, but I’m looking into HBox etc now. It looks like they’re simply the Layout class with the layout type preset for you.