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
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Axis | axis | one of Vertical, Horizontal | Vertical | Which way it runs. |
| Fit | fit | one of Even, Fixed, Elements | Even | How the space is divided. |
| Spacing | spacing | number, at least 0 | 8 | Gap between children, in UI units. |
| Padding | padding | number, at least 0 | 0 | Inset from the stack's own box on every side, in UI units. |
| Item | item | number, at least 0 | 48 | Only used by the Fixed distribution. |
| Align | align | one of Start, Center, End | Start | Where a run shorter than the stack sits in the leftover space. |