Jump to content

[SOLVED] [2.0] Widgets not rendered when parent is overlaped.


photo

Recommended Posts

Hi,

Using last unigine version in Windows 8.1.

In the attached sample (based on menu_box_1) I've only changed labels parent to be in a simple hierarchy:

engine_gui->vbox0->gdx_0->(labels)

When gdx_0 is added to vbox_0 using another ALIGN_* flag different from OVERLAP the widgets are rendered properly, but in this other case the labels are not rendered but remains interactable. You can easily test it in the code.

widgets.zip

Link to comment
  • 2 weeks later...

We did some investigation about this case. Here the results:

 

1) All containers will clip their children to their bounds;

2) The whole idea about 'overlap' mode is that the widget is still in the hierarchy and could be positioned freely yet it takes no role in parent bound calculation;

3) In your case you have vbox (align_center) -> gridbox (overlap) -> a bunch of labels (align_center by default, because they were reparented to gridbox);

 

So what happended is that bounds of gridbox were calculated properly, so that's ok. But because gridbox has 'overlap' mode it tells vbox to ignore gridbox bounds so vbox bounds are zero and that will clip our labels and make them invisible.

 

if you add these lines after your widget setup they'll do the job:

gdx_0.arrange();
vbox0.setWidth(gdx_0.getWidth());
vbox0.setHeight(gdx_0.getHeight());

Soo, not a bug. :)

Link to comment
×
×
  • Create New...