rtalon

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hi! I'm going to try to explain my way. I have a simple scene: Background (PIXI.Sprite), static images (PIXI.Sprite, PIXI.Container, etc) and animations (PIXI.extras.AnimatedSprite). // Background stage.addChild(new PIXI.Sprite(Texture.....)); // I dont want to remove never. // Animations, I save my animations in a array: this.arrayAnimations = []; let animation1 = new PIXI.extras.AnimatedSprite(...); let animation2 = new PIXI.extras.AnimatedSprite(...); let animation3 = new PIXI.extras.AnimatedSprite(...); stage.addChild( animation1 ); stage.addChild( animation2 ); stage.addChild( animation3 ); this.arrayAnimations.push(animation1); this.arrayAnimations.push(animation2); this.arrayAnimations.push(animation3); // I can to access to animations via array this.arrayAnimations[0].play() this.arrayAnimations[0].position / scale // And I can remove it stage.removeChild( this.arrayAnimation[0] ); // in this moment is out from stage but it's in my array to use in another place. // Later, I can destroy the animation this.arrayAnimations[0].destroy(); this.arrayAnimations[0] = null;