Releases: reececomo/pixijs-actions
Releases · reececomo/pixijs-actions
v1.2.5 add Action.animate(…)
v1.2.5
Added Action.animate(…):
- Animate a
Sprite
using textures or a spritesheet. - Features:
- Full timing/actions control
- Reversible
- Auto-resize (default: off)
- Auto-restore (default: on)
Tip
Action.animate(…)
is the stateless analog of creating a PIXI.AnimatedSprite.
Example usage:
// textures
const walkAnimation = Action.animate([
walkTexture1,
walkTexture2,
/*…*/
])
// spritesheet
const runSpritesheet: Spritesheet = Assets.get("runAnimation")
const runAnimation = Action.animate(runSpritesheet, 1/24) // @24 FPS
mySprite.run(Action.repeatForever(
Action.sequence([walkAnimation, runAnimation])
))
Args
Textures – animate( textures, timePerFrame, resize, restore )
Animates changes to a sprite’s texture.
Action.animate(
textures: Textures[],
timePerFrame: number = 1/60,
resize: boolean = false,
restore: boolean = true
)
Spritesheet – animate( spritesheet, timePerFrame, resize, restore, sortByKey )
Play a spritesheet as an animation sheet. By default textures are played in sorted order.
Action.animate(
spritesheet: Spritesheet,
timePerFrame: number = 1/60,
resize: boolean = false,
restore: boolean = true,
sortByKey: boolean = true
)