Skip to main content

Class: AnimationClip

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

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:48

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:23

The frames of the animation.


name

readonly name: string

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

The name of this animation.


onAnimationEndEvent

readonly onAnimationEndEvent: ForgeEvent

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

Event that is raised when the animation ends.


onAnimationFrameChangeEvent

readonly onAnimationFrameChangeEvent: OnAnimationFrameChangeEvent

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

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


onAnimationStartEvent

readonly onAnimationStartEvent: ForgeEvent

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

Event that is raised when the animation starts.


playbackSpeed

playbackSpeed: number

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

Methods

getFrame()

getFrame(index): AnimationFrame

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

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.