Skip to main content

Function: addUiToggleGroupComponent()

addUiToggleGroupComponent(world, entity, options?): UiToggleGroupDefaultedOptions

Defined in: ui/components/ui-toggle-group-component.ts:41

Attaches a UiToggleGroupEcsComponent to entity, making it a radio-group root: any UiToggleEcsComponent whose group references this entity id is mutually exclusive with every other toggle referencing the same group (see createUiToggleEcsSystem). The group entity itself is purely logical - it needs no RectTransformEcsComponent and doesn't have to be an ancestor of the toggles it groups.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options?​

Partial<UiToggleGroupDefaultedOptions> = {}

Options for configuring the group.

Returns​

UiToggleGroupDefaultedOptions

The attached component, for further tuning or runtime changes.