Skip to content

Commit 5dd08c7

Browse files
committed
Allows you to provide an array for the generate methods.
1 parent 7f1f243 commit 5dd08c7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

v3/src/animation/AnimationManager.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ AnimationManager.prototype = {
9696
return child;
9797
},
9898

99-
generateFrameNumbers: function (key, startFrame, endFrame, firstFrame)
99+
generateFrameNumbers: function (key, startFrame, endFrame, firstFrame, out)
100100
{
101-
var out = [];
101+
if (out === undefined) { out = []; }
102102

103103
if (firstFrame)
104104
{
@@ -127,12 +127,12 @@ AnimationManager.prototype = {
127127
* @param {number} [zeroPad=0] - The number of zeros to pad the min and max values with. If your frames are named 'explosion_0001' to 'explosion_0034' then the zeroPad is 4.
128128
* @return {string[]} An array of framenames.
129129
*/
130-
generateFrameNames: function (key, prefix, start, stop, suffix, zeroPad)
130+
generateFrameNames: function (key, prefix, start, stop, suffix, zeroPad, out)
131131
{
132132
if (suffix === undefined) { suffix = ''; }
133133
if (zeroPad === undefined) { zeroPad = 0; }
134+
if (out === undefined) { out = []; }
134135

135-
var output = [];
136136
var diff = (start < stop) ? 1 : -1;
137137

138138
// Adjust because we use i !== stop in the for loop
@@ -142,10 +142,10 @@ AnimationManager.prototype = {
142142
{
143143
var frame = prefix + Pad(i, zeroPad, '0', 1) + suffix;
144144

145-
output.push({ key: key, frame: frame });
145+
out.push({ key: key, frame: frame });
146146
}
147147

148-
return output;
148+
return out;
149149
}
150150

151151
};

0 commit comments

Comments
 (0)