BoxContainer

Inherits:Container<Control<CanvasItem<Node<Object

Inherited By:HBoxContainer,VBoxContainer

A container that arranges its child controls horizontally or vertically.

Description

A container that arranges its child controls horizontally or vertically, rearranging them automatically when their minimum size changes.

Tutorials

Properties

AlignmentMode

alignment

0

bool

vertical

false

Methods

Control

add_spacer(begin:bool)

Theme Properties

int

separation

4


Enumerations

enumAlignmentMode:🔗

AlignmentModeALIGNMENT_BEGIN =0

The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout).

AlignmentModeALIGNMENT_CENTER =1

The child controls will be centered in the container.

AlignmentModeALIGNMENT_END =2

The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout).


Property Descriptions

AlignmentModealignment =0🔗

The alignment of the container's children (must be one ofALIGNMENT_BEGIN,ALIGNMENT_CENTER, orALIGNMENT_END).


boolvertical =false🔗

Iftrue, theBoxContainer will arrange its children vertically, rather than horizontally.

Can't be changed when usingHBoxContainer andVBoxContainer.


Method Descriptions

Controladd_spacer(begin:bool)🔗

Adds aControl node to the box as a spacer. Ifbegin istrue, it will insert theControl node in front of all other children.


Theme Property Descriptions

intseparation =4🔗

The space between theBoxContainer's elements, in pixels.


User-contributed notes

Please read theUser-contributed notes policy before submitting a comment.