Skip to main content

Function: addHorizontalLayoutGroupComponent()

addHorizontalLayoutGroupComponent(world, entity, options?): UiAxisLayoutGroupEcsComponent

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

Attaches a HorizontalLayoutGroupEcsComponent (a UiAxisLayoutGroupEcsComponent arranging children left-to-right) to entity. createUiLayoutGroupEcsSystem arranges every direct child that has a RectTransformEcsComponent and whose LayoutElementEcsComponent.ignoreLayout (if present) isn't true, along the entity's own content box (its resolved rect, inset by padding) - each child's height is the group's cross axis, sized/aligned per childControlHeight/childAlignment.y.

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.