Skip to content

Components

LayoutElement

Says how much room one child wants along its parent's axis, for a Stack sharing space by what each child asks for: the least it will accept, what it wants when there is room, and its share of whatever is left over. Goes under a Canvas.

On this page

Add it

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

From a script

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

rgs
set_number("LayoutElement", "min", 0.0);
set_number("LayoutElement", "preferred", 48.0);
set_number("LayoutElement", "flexible", 0.0);

Fields

FieldScript nameKindDefaultWhat it does
Minminnumber, at least 00Never shrunk below this, even if it overflows.
Preferredpreferrednumber, at least 048What it wants when there is room, in UI units.
Flexibleflexiblenumber, at least 00Share of the leftover space; zero never grows.