Added Frame progress slice.

This commit is contained in:
Richard Davey 2017-04-05 17:04:43 +01:00
parent f7b6b357db
commit 4314fb095f

View file

@ -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;
};