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
Name | Type | Default | Description |
---|---|---|---|
blend-mode |
| BLEND_MODES.NORMAL | The blend mode to be applied to the sprite. |
anchor |
| 0 | The anchor sets the origin point of the text. |
anchor-x | number | 0 | The x anchor sets the origin point of the text. |
anchor-y | number | 0 | The y anchor sets the origin point of the text. |
textures | array | undefined | The textures to use for the animation |
animation-speed | number | 1 | The speed that the AnimatedSprite will play at. Higher is faster, lower is slower |
loop | boolean | true | Whether or not the animate sprite repeats after playing. |
playing | boolean | false | Whether or not the animation is playing. |
more attributes in Container Props and PIXI.AnimatedSprite
AnimatedSprite Events
Name | Type | Description |
---|---|---|
loop | function | when the AnimatedSprite finishes playing. |
frame-change | function | when the AnimatedSprite changes to a new frame. |
complete | function | when the AnimatedSprite finishes playing. |
render | function | custom rendering listener |
more events in Container Events