Skip to main content

Function: createAnimation()

createAnimation(animationName, spritesPerColumn, spritesPerRow, frameDurationSeconds, options?): Animation

Defined in: animations/utilities/create-animation.ts:92

Parameters

animationName

string

The name of the animation (e.g., 'walk', 'run').

spritesPerColumn

number

The number of sprites in each column of the sprite sheet.

spritesPerRow

number

The number of sprites in each row of the sprite sheet.

frameDurationSeconds

The duration of each animation frame in seconds. This can be a single number for all frames or an array of numbers for each frame. If an array is provided, its length must match the total number of frames.

number | number[]

options?

Partial<AnimationCreationParams>

Optional parameters for creating the animation set.

Returns

Animation

An Animation object containing the generated animation frames.