Skip to main content

Function: selectAnimationFrames()

selectAnimationFrames(spriteSheet, numberOfFrames, startFrame?): AnimationFrame[]

Defined in: animations/utilities/select-animation-frames.ts:11

Selects a contiguous run of frames from a sprite sheet, in row-major order, to build an animation clip.

Parameters

spriteSheet

SpriteSheet

An array of AnimationFrame objects representing the frames in the sprite sheet.

numberOfFrames

number

The total number of frames to include in the animation. This should not exceed the total frames available in the sprite sheet.

startFrame?

number = 0

The index of the first frame to include in the animation. Default is 0 (the first frame in the sprite sheet).

Returns

AnimationFrame[]

An Animation object containing the generated animation frames.