I wanted to play multiple animations with a AnimatedSprite.
I setup the animated sprite in following manner.
this.spriteSheet = this.loader.resources["images/atlus_runner.json"].spritesheet
this.anim = new PIXI.extras.AnimatedSprite(
this.spriteSheet.animations["walk"]
);
this.anim.animationSpeed = 0.2;
this.anim.loop = true;
this.anim.play();
this.addChild(this.anim);
When I wanted to play another animation, I did it in following manner
var newAnim = this.spriteSheet.animations["jump"];
this.anim.stop();
this.anim.textures = newAnim;
this.anim.play();
I stop the current animation, set the new textures and play animation again.
Is this the correct way of playing another animation?