Not sure how to change the layout of the nodes

Godot Version

4.6.1.stable

Question

I’d like the “Buy airship” and airship count to be on the left of the screen, with the exit button on the right, while the “Welcome” label stays on the center of the top of the screen. Below is what I ahve so far:

This is how I have the nodes organized:

Both the HBox and Vbox nodes have Center alignment. I’m not sure how to keep the “Buy airship” and airship count to the left corner, with the exit button on the right corner, with the welcome label on the center of the viewport.

Use extra Control nodes between the elements you want to push to each side with their Control.size_flag_horizontal set to SizeFlags.SIZE_EXPAND_FILL. To do this from the editor enable Expand under Layout/Container Sizing

1 Like

Check out this guys videos!

1 Like

Thank you. It’s a step in the right direction, but this was the result:

image

This is how the nodes are arraigned:

And these are the container sizing settings of the three control nodes:

How do I ensure the “Exit” button stays at the right side? And how do I ensure the “welcome_label” stays centered in the middle?

I believe they meant not as parents of the other nodes, but siblings.

HBoxContainer
→ VBox | welcome_label | spacer_control | Exit

You can set the spacer_control node to expand

This video helped me a lot: https://www.youtube.com/watch?v=1_OFJLyqlXI&t=725s

1 Like

Understood, that resolved it, thank you!