Skip to main content

Function: addCanvasGroupComponent()

addCanvasGroupComponent(world, entity, options?): CanvasGroupDefaultedOptions

Defined in: ui/components/canvas-group-component.ts:85

Attaches a CanvasGroupEcsComponent to entity. Read by resolveCanvasGroupState and applied by createUiCanvasGroupEcsSystem (alpha) and by createUiRaycastEcsSystem/createUiInteractionEcsSystem/ createUiNavigationEcsSystem (interactable/blocksRaycasts) to every UI descendant of entity - a whole panel, modal, or HUD section can be faded, disabled, or made click-through with one component instead of one per element.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options?​

Partial<CanvasGroupDefaultedOptions> = {}

Options for configuring the canvas group.

Returns​

CanvasGroupDefaultedOptions

The attached component, for further tuning or runtime changes.