Skip to main content

Function: addUiColorTransitionComponent()

addUiColorTransitionComponent(world, entity, options?): UiColorTransitionEcsComponent

Defined in: ui/components/ui-color-transition-component.ts:74

Attaches a UiColorTransitionEcsComponent to entity. Needs a UiInteractableEcsComponent (to derive the visual state from) and a SpriteEcsComponent (whose tintColor createUiTransitionEcsSystem eases) on the same entity.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options?​

Partial<UiColorTransitionDefaultedOptions> = {}

Options for configuring the transition. Colors default to Color.white (i.e. no tint change) for any state not given.

Returns​

UiColorTransitionEcsComponent

The attached component, for further tuning or runtime changes.