When adding a new Animation to a Sprite it would incorrectly reset the current Sprite frame to the first frame of the animation sequence, it is now left un-touched until you call play on the animation.

This commit is contained in:
photonstorm 2014-07-03 23:59:10 +01:00
parent 65a7e1b762
commit 77d5be1d8e
2 changed files with 5 additions and 8 deletions

View file

@ -165,12 +165,7 @@ Calling addToWorld() would previously not check the _toRemove array, which could
* Calling Tween.stop from inside a Tween update callback would still cause the tween onComplete event to fire (thanks @eguneys, #924)
* Group.bringToTop (and consequently Sprite.bringToTop) no longer removes the child from the InputManager if enabled (thanks @BinaryMoon, fix #928)
* Group.sendToBack (and consequently Sprite.sendToBack) no longer removes the child from the InputManager if enabled.
### ToDo
When you add an animation it over-rides the default set frame to the first frame of the animation.
* When adding a new Animation to a Sprite it would incorrectly reset the current Sprite frame to the first frame of the animation sequence, it is now left un-touched until you call `play` on the animation.

View file

@ -159,11 +159,13 @@ Phaser.AnimationManager.prototype = {
this.currentAnim = this._anims[name];
this.currentFrame = this.currentAnim.currentFrame;
this.sprite.setFrame(this.currentFrame);
// this.sprite.setFrame(this.currentFrame);
// CHECK WE STILL NEED THIS - PRETTY SURE IT DOESN'T ACTUALLY DO ANYTHING!
if (this.sprite.__tilePattern)
{
this.__tilePattern = false;
// this.__tilePattern = false;
this.sprite.__tilePattern = false;
this.tilingTexture = false;
}