Skip to content

createAnimationsFromNaming

createAnimationsFromNaming(spriteSheet, prefix, options?): Animation[]

Defined in: packages/three-flatland/src/animation/utils.ts:61

Create animations from a naming convention. Assumes frames are named: {prefix}_{animationName}_{frameIndex}

SpriteSheet

string

number

boolean

Animation[]

// Auto-detect animations from frames like 'player_idle_0', 'player_walk_0', etc.
const animations = createAnimationsFromNaming(sheet, 'player');