Skip to main content

Class: SpriteAnimationComponent

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

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

Implements

Constructors

Constructor

new SpriteAnimationComponent(animationController, animationInputs, playbackSpeed): SpriteAnimationComponent

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

Creates an instance of SpriteAnimationComponent.

Parameters

animationController

AnimationController

The AnimationController managing the animations.

animationInputs

AnimationInputs

The inputs used to determine the current animation.

playbackSpeed

number = 1

The speed multiplier for the animation playback.

Returns

SpriteAnimationComponent

Properties

animationController

animationController: AnimationController

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

The animation controller responsible for managing the animations.


animationFrameIndex

animationFrameIndex: number

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

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.


currentAnimation

currentAnimation: Animation

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

The current animation being played.


lastFrameChangeTimeInSeconds

lastFrameChangeTimeInSeconds: number

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

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


name

name: symbol

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

The unique name of the component.

Implementation of

Component.name


playbackSpeed

playbackSpeed: number

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

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

Default

1

symbol

readonly static symbol: typeof symbol

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