Class: LayoutComponent
Auto-arranges children: writes their TransformComponent.x/y directly, overriding any Widget settings on those children. Children iterate in HierarchyComponent.children order; inactive ones are skipped. For Grid, maxColumns=0 means "as many as fit per row".
Sizing reacts every frame: inserting/removing/toggling children or (when affectedByChildScale is set) rescaling them re-flows the layout and, under resizeMode, re-fits the sizes.
Extends
Constructors
Constructor
ts
new LayoutComponent(): LayoutComponent;Returns
LayoutComponent
Inherited from
Properties
| Property | Modifier | Type | Default value | Description | Inherited from |
|---|---|---|---|---|---|
affectedByChildScale | public | boolean | undefined | When true, a child's taken size is its UITransform size × | transform scale |
alignment | public | LayoutAlignment | undefined | - | - |
dirty | public | boolean | true | - | Component.dirty |
enabled | public | boolean | true | - | Component.enabled |
maxColumns | public | number | undefined | - | - |
paddingBottom | public | number | undefined | - | - |
paddingLeft | public | number | undefined | - | - |
paddingRight | public | number | undefined | - | - |
paddingTop | public | number | undefined | - | - |
resizeMode | public | LayoutResizeMode | undefined | - | - |
spacingX | public | number | undefined | - | - |
spacingY | public | number | undefined | - | - |
type | public | LayoutType | undefined | - | - |