Size of UI Containers reset upon Engine restart

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Jefferson

I’m having an extremely frustrating problem with my UI; the size resets upon restarting the engine. I have it set up as follows:

CenterContainer
    -> VBoxContainer
        -> menu item 1 (TextureButton)
        -> menu item 2 (TextureButton)
        -> menu item 3 (TextureButton)

Both containers’ size flags are set to ‘Horizontal: fill, expand’ and ‘Vertical: fill, expand’. I had this exact issue before too, and setting the flags to the aforementioned settings worked. That was before adding the parent CenterContainer, though.

Not sure if worth mentioning, but the above nodes reside in another VBoxContainer, also set to ‘fill, expand’.

:bust_in_silhouette: Reply From: chanon

I’d suggest trying setting “Stretch Ratio” under Size Flags to 0. It worked for me once. Also try it with enabling/disabling the other flags.

Coming from Godot 2.1, Godot 3’s container sizing/positioning is pretty confusing. I still don’t completely understand it either.

First of all, thanks for commenting, I appreciate the help.

I’ve set the scale ratio of all the parent and child nodes to 0 and toyed around with the other flags with no success. In fact, toggling the expand and fill flags of the other nodes screwed with it even more.

It goes back to a functional state upon removing the CenterContainer. Thing is, I kind of need it. Are there other settings relating to how VBoxContainers are contained within a CenterContainer that I must look at?

Jefferson | 2018-03-03 13:27