How can I justify child of HBoxContainer?

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

If I have an HBoxContainer with 3 children, how can I justify the spacing of its children automatically? I know I can hard-code it by using the custom_constants/separation property but I want the spacing to be automatic.

What do you mean by “justify”? Do you mean centering the children of the HBoxContainer node?

Ertain | 2020-09-22 00:42

Equal spacing between the children of HBoxContainer.

kasper | 2020-09-22 04:57

:bust_in_silhouette: Reply From: rakkarage

you can select all children and select Size Flags → Expand (if there is room) and they will each expand to an equal size

you can select all children and select Rect->Min Size to make them all the same with or height

you can put empty Control nodes between children and set min size or expand too