eugene.litvinov Posted March 2, 2011 Posted March 2, 2011 WidgetVBox and WidgetHBox have different results with children align: WidgetVBox mainPanelA = new WidgetVBox(gui); gui.addChild(mainPanelA, 0); WidgetSprite facePanel_1 = new WidgetSprite(gui, "source/textures/first.png"); mainPanelA.addChild(facePanel_1, GUI_ALIGN_BACKGROUND); WidgetSprite facePanel_3 = new WidgetSprite(gui, "source/textures/second.png"); mainPanelA.addChild(facePanel_3, GUI_ALIGN_OVERLAP); facePanel_3.setBlendFunc(GUI_BLEND_SRC_ALPHA, GUI_BLEND_ONE_MINUS_SRC_ALPHA); facePanel_3.setColor(vec4(1.0f, 1.0f, 1.0f, 0.6f)); WidgetHBox mainPanelA = new WidgetHBox(gui); gui.addChild(mainPanelA, 0); WidgetSprite facePanel_1 = new WidgetSprite(gui, "source/textures/first.png"); mainPanelA.addChild(facePanel_1, GUI_ALIGN_BACKGROUND); WidgetSprite facePanel_3 = new WidgetSprite(gui, "source/textures/second.png"); mainPanelA.addChild(facePanel_3, GUI_ALIGN_OVERLAP); facePanel_3.setBlendFunc(GUI_BLEND_SRC_ALPHA, GUI_BLEND_ONE_MINUS_SRC_ALPHA); facePanel_3.setColor(vec4(1.0f, 1.0f, 1.0f, 0.6f)); results:
frustum Posted March 2, 2011 Posted March 2, 2011 VBox is always expands horizontally inside the other VBox. HBox is always expands vertically inside the other HBox. Gui has internal VBox container. And because of this your mainPanelA widget is expanded.
Recommended Posts