Constructor
new UILayout(posopt, columnsopt, gapopt, paddingopt, transparentopt)
Create a UILayout container that auto-arranges children
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
pos | Vector2 | <optional> | ||
columns | number | <optional> | 1 | Number of columns (1 = vertical list) |
gap | number | <optional> | 10 | Space between children |
padding | number | <optional> | 10 | Space between container border and children |
transparent | boolean | <optional> | false | If true, draws no background, outline, or shadow |
- Source
Extends
- UIObject
Members
columns
Properties| Type | Description |
|---|---|
| number | Number of columns in the layout |
- Source
gap
Properties| Type | Description |
|---|---|
| number | Space between children |
- Source
padding
Properties| Type | Description |
|---|---|
| number | Space between container border and children |
- Source
Methods
addChild(child) → {UIObject}
Add a child UIObject and re-layout
Parameters:
| Name | Type | Description |
|---|---|---|
child | UIObject |
- Source
Returns:
The child object added
- Type:
- UIObject
relayout()
Recompute child positions and container size based on per-child sizes. Called automatically by addChild and removeChild. Call manually if you mutate a child's size or change columns, gap, or padding.
- Source
removeChild(child)
Remove a child UIObject and re-layout
Parameters:
| Name | Type | Description |
|---|---|---|
child | UIObject |
- Source