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()andUI.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:
- 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:
- 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:
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.constraintfixes, ignored when the constraint isUI.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