photonstorm/phaser — pull request #466 by georgiee (2014-02-20 20:38:36+00:00)
Title: Feature localframe

I'm working with some animations in Phaser. It's a really easy to implement with Phaser. But I think I discovered a bug or at least an unexpected behaviour with the Phaser.Animation frame setter which I need to do some manual frame animation calculations.

Look at the following example:
```js
jellyfish = game.add.sprite(670, 20, 'seacreatures');
frameNames = Phaser.Animation.generateFrameNames('crab1', 0, 25, '', 4)
aniInstance = jellyfish.animations.add('swim', frameNames);

//I do not want to call play I just want to select one of the 25 created frameNames
//but this will show me the octopus ( as it's the very first frame ('blueJellyfish0000') in the atlas file)
//This should translate to the local frame number which is the number of frame 'crab10000'
aniInstance.frame = 0
```
I cannot determine if this frame accessor is working as expected or if it's a simple bug.
My pull requests is again not to merge. It's just an example how I expected it. I used another accessor name ('localframe' instead of 'frame') to prevent any side effects of this change. The one and only difference is in line number 449.

Can you tell me why frame uses such a 'global' frame management ? Thank you!

Instead of maintaining this change in my local branches I will stick to the following workaround for now:
```
aniInstance.frame = aniInstance._frames[0] // mimics aniInstance.localframe = 0
```