Skip to content

Class: SpriteAnimator

SpriteAnimator is a component for storing sprite animation information. The SpriteAnimator can contain multiple SpriteAnimations, which can be selected and set as the current animation. SpriteAnimator can be used to add sprite animation, and allows defining different animations. SpriteAnimator should be used with a Sprite component in conjunction.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

+ new SpriteAnimator(animations: Map<string, SpriteAnimation>, current?: undefined | string): SpriteAnimator

Parameters:

Name Type
animations Map<string, SpriteAnimation>
current undefined | string

Returns: SpriteAnimator

Inherited from: Component

Properties

animations

animations: Map<string, SpriteAnimation>

A map of SpriteAnimations, which are available to the SpriteAnimator as different animations to switch between.


current

current: undefined | string

The key of the current SpriteAnimation in the animations map, if this is undefined there is no active animation.


key

key: string

Inherited from: Component.key


KEY

Readonly Static KEY: sprite_animator= "sprite_animator"

Key of the sprite animator component.


MESSAGE_ADD

Readonly Static MESSAGE_ADD: component_add= "component_add"

Inherited from: Component.MESSAGE_ADD


MESSAGE_REMOVE

Readonly Static MESSAGE_REMOVE: component_remove= "component_remove"

Inherited from: Component.MESSAGE_REMOVE

Methods

Free

Free(): void

Returns: void

Inherited from: Component