Skip to main content

Class: SpriteAnimationComponent

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

Component to store sprite animation information for entities, such as from sprite sheets.

Extends

Constructors

Constructor

new SpriteAnimationComponent(stateMachine, startingInputs, frameDurationMilliseconds, playbackSpeed): SpriteAnimationComponent

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

Creates an instance of SpriteAnimationComponent.

Parameters

stateMachine

FiniteStateMachine<AnimationInputs, AnimationClip>

The FiniteStateMachine managing the animations.

startingInputs

AnimationInputs

The inputs used to determine the current animation.

frameDurationMilliseconds

number = 33.3333

The duration (in milliseconds) of each frame in the animation. Defaults to 33.3333 ms (30 fps).

playbackSpeed

number = 1

The speed multiplier for the animation playback. Defaults to 1.

Returns

SpriteAnimationComponent

Overrides

Component.constructor

Properties

animationFrameIndex

animationFrameIndex: number

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

The current frame index of the animation being played.


animationInputs

animationInputs: AnimationInputs

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

The inputs used to determine the current animation from animation transitions.


frameDurationMilliseconds

frameDurationMilliseconds: number

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

The duration (in milliseconds) of each frame in the animation.


lastFrameChangeTimeInSeconds

lastFrameChangeTimeInSeconds: number

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

The last time (in seconds) the animation frame was changed.


playbackSpeed

playbackSpeed: number

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

The speed multiplier for the animation playback. Larger values result in faster playback.


stateMachine

stateMachine: FiniteStateMachine<AnimationInputs, AnimationClip>

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

The animation controller responsible for managing the animations.

Accessors

id

Get Signature

get static id(): symbol

Defined in: ecs/types/Component.ts:12

The unique id of the component.

Returns

symbol

Inherited from

Component.id