Skip to main content

Function: addSpriteAnimationComponent()

addSpriteAnimationComponent(world, entity, options): SpriteAnimationEcsComponent

Defined in: animations/components/sprite-animation-component.ts:69

Attaches a SpriteAnimationEcsComponent to entity.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options​

SpriteAnimationRequiredOptions & Partial<SpriteAnimationEcsComponent>

Options for configuring the sprite animation. animationClipHandle has no sensible default and must always be provided.

Returns​

SpriteAnimationEcsComponent

The attached component, for further tuning or runtime changes.