Animator

Constructors

new

Animator

()

Creates a new instance of the Animator object


Properties

image

:

Surface

get

Gets the current animation frame

animations

:

string[]

get

Gets names of animations

currentAnimation

:

string

get

Gets the name of the current animation

onEndAnimationLoop

:

EndAnimationLoopCallback | null

get set

Gets or sets a callback function occurred on end of the animation


Methods

add

(name: string, options: AddAnimationOptions) ⇨ Promise<void>

Adds an animation to the Animator

bulk

(list: [AnimationName, AnimationSource], options: AddAnimationOptions) ⇨ Promise<void>

Adds the list of an animation to the Animator

entry

(name: string) ⇨ void

Sets the start animation

addTransition

(transition: AnimationTransition) ⇨ void

Adds a transition between animations

set

(name: string) ⇨ void

Sets the animation as current

play

() ⇨ void

Plays the animation

pause

() ⇨ void

Pauses the animation

stop

() ⇨ void

Stops the animation

tick

() ⇨ void

Counts the time until the frame is switched