Skip to content

Commit

Permalink
Sprite animation data wasn't reset when going from a sprite sheet to …
Browse files Browse the repository at this point in the history
…a single frame in Sprite.loadTexture (thanks @lucbloom, fix #850)
  • Loading branch information
photonstorm committed May 27, 2014
1 parent 5a0d5b4 commit 0c76e9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Version 2.0.6 - "Jornhill" - -in development-
* BitmapData.resize now properly updates the baseTexture and texture dimensions.
* Fixed Gamepad issue that incorrectly checked non-webkit prefix gamepads.
* Phaser.RenderTexture incorrectly passed the scaleMode to Pixi.RenderTexture, causing the renderer to error.
* Sprite animation data wasn't reset when going from a sprite sheet to a single frame in Sprite.loadTexture (thanks @lucbloom, fix #850)

### Migration Guide

Expand Down
3 changes: 1 addition & 2 deletions src/gameobjects/Sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,6 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) {
if (this.game.cache.isSpriteSheet(key))
{
this.key = key;

// var frameData = this.game.cache.getFrameData(key);
this.animations.loadFrameData(this.game.cache.getFrameData(key));

if (typeof frame === 'string')
Expand All @@ -406,6 +404,7 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) {
{
this.key = key;
this.setTexture(PIXI.TextureCache[key]);
this.animations.loadFrameData(null);
return;
}
}
Expand Down

0 comments on commit 0c76e9a

Please sign in to comment.