From cf3796d60c31cca4727c920a7698ca3dedbe0bf1 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Fri, 21 Feb 2014 10:31:17 +0000 Subject: [PATCH] Phaser.Animation.frame now returns the frame of the current animation, rather than the global frame from the sprite sheet / atlas (fix #466) --- README.md | 1 + src/animation/Animation.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e5daaae..fc5d607b 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Significant API changes: * Cache.getImageKeys and similar has been removed, please use Cache.getKeys(Phaser.Cache.IMAGE) instead, this now supports all 10 Cache data types. * After defining tiles that collide on a Tilemap, you need to call Tilemap.generateCollisionData(layer) to populate the physics world with the data required. * Phaser.QuadTree has been removed from core and moved to a plugin. It's no longer required, nor works with the physics system. +* Phaser.Animation.frame now returns the frame of the current animation, rather than the global frame from the sprite sheet / atlas. New features: diff --git a/src/animation/Animation.js b/src/animation/Animation.js index a6193421..03f0d555 100644 --- a/src/animation/Animation.js +++ b/src/animation/Animation.js @@ -416,7 +416,7 @@ Object.defineProperty(Phaser.Animation.prototype, 'frame', { set: function (value) { - this.currentFrame = this._frameData.getFrame(value); + this.currentFrame = this._frameData.getFrame(this._frames[value]); if (this.currentFrame !== null) {