Skip to main content

Function: addVerticalLayoutGroupComponent()

addVerticalLayoutGroupComponent(world, entity, options?): UiAxisLayoutGroupEcsComponent

Defined in: ui/components/layout-group-component.ts:148

Attaches a VerticalLayoutGroupEcsComponent (a UiAxisLayoutGroupEcsComponent arranging children top-to-bottom) to entity. Otherwise identical to addHorizontalLayoutGroupComponent, with the main/cross axes swapped - width is the cross axis, sized/aligned per childControlWidth/childAlignment.x.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to. Its own RectTransformEcsComponent supplies the group's content box - add one first if entity doesn't already have one (e.g. via createPanel).

options?​

Partial<UiAxisLayoutGroupDefaultedOptions> = {}

Options for configuring the group.

Returns​

UiAxisLayoutGroupEcsComponent

The attached component, for further tuning or runtime changes.