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.addHorizontalLayout(),UI.Panel.addVerticalLayout()andUI.Panel.addGridLayout().- Layout.getSpacing()#
- Layout.setSpacing(value)#
The gap left between the elements, in pixels. A grid layout uses it in both directions.
- Property:
Can be read or written
- Return type:
number
- Layout.getPadding()#
- Layout.setPadding(value)#
The gap left inside the edges of the panel.
- Property:
Can be read or written
- Return type:
- Layout.getChildAlignment()#
- Layout.setChildAlignment(value)#
Where the elements are placed within the space the layout has to fill.
- Property:
Can be read or written
- Return type:
- Layout.getCellSize()#
- Layout.setCellSize(value)#
The size of each cell of a grid layout, in pixels.
- Property:
Can be read or written
- Return type:
[number, number]
Note
Only applies to a grid layout. Throws an exception for the other layouts, whose elements are sized individually using their layout elements.
- Layout.getConstraint()#
- Layout.setConstraint(value)#
What fixes the shape of a grid layout.
- Property:
Can be read or written
- Return type:
Note
Only applies to a grid layout. Throws an exception for the other layouts.
- Layout.getConstraintCount()#
- Layout.setConstraintCount(value)#
The number of columns or rows that
UI.Layout.getConstraint()fixes, ignored when the constraint isUI.GridConstraint.flexible.- Property:
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(fields)#
The gap left inside each edge of a layout, in whole pixels.
Note
- Padding.left#
The gap inside the left edge.
- Type:
number
- Padding.right#
The gap inside the right edge.
- Type:
number
- Padding.top#
The gap inside the top edge.
- Type:
number
- Padding.bottom#
The gap inside the bottom edge.
- Type:
number
- class UI.GridConstraint()#
What fixes the shape of a grid layout.
- GridConstraint.flexible#
Fit as many columns and rows as the size of the panel allows.
- GridConstraint.fixedColumnCount#
Use a fixed number of columns, and as many rows as are needed.
- GridConstraint.fixedRowCount#
Use a fixed number of rows, and as many columns as are needed.