Skip to content

AnimatedSprite

Creates a AnimatedSprite

A simple way to display an animation depicted by a list of textures.

I recommend using spritesheets created by TexturePacker (they have a great tutorial on it). If you don’t want to use spritesheets, you can simply just pass in an array of your desired textures.

Spritesheet

Multiple Animations from Spritesheet

API

AnimatedSprite Attributes

NameTypeDefaultDescription
blend-modeBLEND_MODES.NORMALThe blend mode to be applied to the sprite.
anchor

number array object

0The anchor sets the origin point of the text.
anchor-xnumber0The x anchor sets the origin point of the text.
anchor-ynumber0The y anchor sets the origin point of the text.
texturesarrayundefinedThe textures to use for the animation
animation-speednumber1The speed that the AnimatedSprite will play at. Higher is faster, lower is slower
loopbooleantrueWhether or not the animate sprite repeats after playing.
playingbooleanfalseWhether or not the animation is playing.

more attributes in Container Props and PIXI.AnimatedSprite

AnimatedSprite Events

NameTypeDescription
loopfunctionwhen the AnimatedSprite finishes playing.
frame-changefunctionwhen the AnimatedSprite changes to a new frame.
completefunctionwhen the AnimatedSprite finishes playing.
renderfunctioncustom rendering listener

more events in Container Events