Layout#

class UI.Layout#

Arranges the elements of a panel automatically, so that they do not have to be positioned one by one. See UI.Panel.add_horizontal_layout(), UI.Panel.add_vertical_layout() and UI.Panel.add_grid_layout().

spacing: number#

The gap left between the elements, in pixels. A grid layout uses it in both directions.

Attribute:

Can be read or written

Return type:

number

padding: UI.Padding#

The gap left inside the edges of the panel.

Attribute:

Can be read or written

Return type:

UI.Padding

child_alignment: UI.TextAnchor#

Where the elements are placed within the space the layout has to fill.

Attribute:

Can be read or written

Return type:

UI.TextAnchor

cell_size: Tuple#

The size of each cell of a grid layout, in pixels.

Attribute:

Can be read or written

Return type:

Tuple

Note

Only applies to a grid layout. Throws an exception for the other layouts, whose elements are sized individually using their layout elements.

constraint: UI.GridConstraint#

What fixes the shape of a grid layout.

Attribute:

Can be read or written

Return type:

UI.GridConstraint

Note

Only applies to a grid layout. Throws an exception for the other layouts.

constraint_count: number#

The number of columns or rows that UI.Layout.constraint fixes, ignored when the constraint is UI.GridConstraint.flexible.

Attribute:

Can be read or written

Return type:

number

Note

Only applies to a grid layout. Throws an exception for the other layouts.

class UI.Padding#

The gap left inside each edge of a layout, in whole pixels.

Note

See UI.Layout.padding.

left: number#

The gap inside the left edge.

Return type:

number

right: number#

The gap inside the right edge.

Return type:

number

top: number#

The gap inside the top edge.

Return type:

number

bottom: number#

The gap inside the bottom edge.

Return type:

number

class UI.GridConstraint#

What fixes the shape of a grid layout.

flexible#

Fit as many columns and rows as the size of the panel allows.

fixed_column_count#

Use a fixed number of columns, and as many rows as are needed.

fixed_row_count#

Use a fixed number of rows, and as many columns as are needed.