mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Added Frame progress slice.
This commit is contained in:
parent
f7b6b357db
commit
4314fb095f
1 changed files with 11 additions and 1 deletions
|
@ -15,8 +15,9 @@ var GetFrames = function (textureManager, frames)
|
|||
var prev;
|
||||
var animationFrame;
|
||||
var index = 1;
|
||||
var i;
|
||||
|
||||
for (var i = 0; i < frames.length; i++)
|
||||
for (i = 0; i < frames.length; i++)
|
||||
{
|
||||
var item = frames[i];
|
||||
|
||||
|
@ -59,6 +60,15 @@ var GetFrames = function (textureManager, frames)
|
|||
|
||||
out[0].prevFrame = animationFrame;
|
||||
|
||||
// Generate the progress data
|
||||
|
||||
var slice = 1 / (out.length - 1);
|
||||
|
||||
for (i = 0; i < out.length; i++)
|
||||
{
|
||||
out[i].progress = i * slice;
|
||||
}
|
||||
|
||||
return out;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue