Skip to main content

Class: Animation

Defined in: animations/types/Animation.ts:20

Interface representing a group of animation frames for a specific animation name.

Constructors

Constructor

new Animation(name, frames): Animation

Defined in: animations/types/Animation.ts:51

Creates an instance of Animation.

Parameters

name

string

The name of the animation.

frames

AnimationFrame[]

The frames of the animation.

Returns

Animation

Properties

frames

frames: AnimationFrame[]

Defined in: animations/types/Animation.ts:29

The frames of the animation.


name

readonly name: string

Defined in: animations/types/Animation.ts:24

The name of this animation.


onAnimationEndEvent

onAnimationEndEvent: OnAnimationChangeEvent

Defined in: animations/types/Animation.ts:39

Event that is raised when the animation ends.


onAnimationFrameChangeEvent

onAnimationFrameChangeEvent: OnAnimationFrameChangeEvent

Defined in: animations/types/Animation.ts:44

Event that is raised every frame change. This includes the first and last frame change of an animation


onAnimationStartEvent

onAnimationStartEvent: OnAnimationChangeEvent

Defined in: animations/types/Animation.ts:34

Event that is raised when the animation starts.

Methods

getFrame()

getFrame(frameIndex): AnimationFrame

Defined in: animations/types/Animation.ts:75

Gets a specific frame of the animation, looping if the index exceeds the number of frames.

Parameters

frameIndex

number

The index of the frame to retrieve.

Returns

AnimationFrame

The requested AnimationFrame.