Skip to main content

Function: addUiFocusComponent()

addUiFocusComponent(world, entity, options?): UiFocusEcsComponent

Defined in: ui/components/ui-focus-component.ts:41

Attaches a UiFocusEcsComponent to entity, overriding createUiNavigationEcsSystem's automatic nearest-neighbor search on whichever sides are given. Needs a UiInteractableEcsComponent on the same entity to be reachable by navigation in the first place.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options?​

UiFocusEcsComponent = {}

The directional overrides to set. Sides left unset keep the automatic search.

Returns​

UiFocusEcsComponent

The attached component, for further tuning or runtime changes.