Skip to main content

Class: AnimationClip

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

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

Constructors

Constructor

new AnimationClip(name, frames, playbackSpeed): AnimationClip

Defined in: animations/types/AnimationClip.ts:54

Creates an instance of Animation.

Parameters

name

string

The name of the animation.

frames

AnimationFrame[]

The frames of the animation.

playbackSpeed

number = 1

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

Returns

AnimationClip

Properties

frames

readonly frames: AnimationFrame[]

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

The frames of the animation.


name

readonly name: string

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

The name of this animation.


onAnimationEndEvent

readonly onAnimationEndEvent: OnAnimationChangeEvent

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

Event that is raised when the animation ends.


onAnimationFrameChangeEvent

readonly onAnimationFrameChangeEvent: OnAnimationFrameChangeEvent

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

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


onAnimationStartEvent

readonly onAnimationStartEvent: OnAnimationChangeEvent

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

Event that is raised when the animation starts.


playbackSpeed

playbackSpeed: number

Defined in: animations/types/AnimationClip.ts:46

Methods

getFrame()

getFrame(index): AnimationFrame

Defined in: animations/types/AnimationClip.ts:84

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

Parameters

index

number

The index of the frame to retrieve.

Returns

AnimationFrame

The requested AnimationFrame.