Hi,

I'm looking for a container that is simply taking my nodes and arranges them vertically with a constant space between them, I though I should pick VBoxContainer, was trying to make a title screen, made a scene with a VBoxContainer inside I have my Logo image which is a textureRect, and underneath I have another VBoxContainer containing 2 buttons - play and exit. but the nodes are not centered, the only way I get them to center is if I select on "size flags" "shrink center" on horizontal and vertical on both containers. but then I can't change the items size, can't scale the items in the container, all I wanted is to be able to change the size of the items but have the container lay them out vertically,

  1. What is the logic in taking away my freedom to scale the nodes inside a VBoxContainer? does it serve some other purpose?
  2. Am I use the wrong node for the task... ?

Do you have the min size property set in the children node(s) of the VBoxContainer?

Last I knew, the VBoxContainer will size the items based on the value in the min size property. I believe this is to make it easier for the VBoxContainer to find a size that will fit all of the children nodes, where the largest min size property is used as the size for all of the child nodes within the VBoxContainer.

Regardless of what it is for, I believe setting the min size property will allow you to change the size of the children nodes. Hopefully this helps!

Yes, it worked, thank you. Though I don't understand why I can't just ask the VBoxContainer to simply center all the items on the horizontal level.

    3 years later
    7 months later

    DanielKotzer
    I encountered what I thought was this issue, but it turns out I had the margins set improperly and as a result the BoxContainer didn't have an appropriate initial size to stretch the child nodes into.

    Double check the margins on the widgets you have all the way down the chain, from the BoxContainer down to the items you're putting into them. If they're set properly with the size flags and margins, they Do work and properly scale up & down your items. (At least they are for me, I really had to double check as some of the margins got defaulted to 0 in the hierarchy somehow while I was working)