Skip to content

Components

Stack

Arranges its children along one axis — a menu, a toolbar — dividing the space evenly by default, or giving every child a fixed size, or letting a Layout Element on each child ask for its own share. Goes under a Canvas.

On this page

Add it

+ Add node → Stack creates a node with it already on. Already have a node for it? Add component → StackComponent.

From a script

A script on the same node writes these fields by name. StackComponent is the name to pass.

rgs
set_number("StackComponent", "spacing", 8.0);
set_number("StackComponent", "padding", 0.0);
set_number("StackComponent", "item", 48.0);

Fields

FieldScript nameKindDefaultWhat it does
Axisaxisone of Vertical, HorizontalVerticalWhich way it runs.
Fitfitone of Even, Fixed, ElementsEvenHow the space is divided.
Spacingspacingnumber, at least 08Gap between children, in UI units.
Paddingpaddingnumber, at least 00Inset from the stack's own box on every side, in UI units.
Itemitemnumber, at least 048Only used by the Fixed distribution.
Alignalignone of Start, Center, EndStartWhere a run shorter than the stack sits in the leftover space.