0 votes

I tried all green nodes godot can offer but could not figure this out.
I am trying to vertically line up control nodes, for example labels so they do not occupy more space than they need to. I will need it to react in real time if I add another labels or buttons.

Which nodes, flags or something else should do it?

example image

On the left is what I want.
On the right is when it occupies more space.

in Engine by (329 points)

1 Answer

0 votes
Best answer

A VBoxContainer might be what you need. Additionally, you can change its "separation" under Custom constants to 0 and activate the constant with the left checkbox.

It will resize automatically when you add or remove nodes.

by (48 points)
selected by

On a side note, if you see your controls shrink to a very small size, you have to give them a minimum size (because the current size becomes controlled by the VBoxContainer).

thank you both. Indeed had a problem with shrinking and minimum size worked nicely.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.