forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimationJSONFile.js
More file actions
32 lines (26 loc) · 821 Bytes
/
Copy pathAnimationJSONFile.js
File metadata and controls
32 lines (26 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var JSONFile = require('./JSONFile.js');
var AnimationJSONFile = function (key, url, path, xhrSettings)
{
var json = new JSONFile(key, url, path, xhrSettings);
// Override the File type
json.type = 'animationJSON';
return json;
};
AnimationJSONFile.create = function (loader, key, url, xhrSettings)
{
if (Array.isArray(key))
{
for (var i = 0; i < key.length; i++)
{
// If it's an array it has to be an array of Objects, so we get everything out of the 'key' object
loader.addFile(new AnimationJSONFile(key[i], url, loader.path, xhrSettings));
}
}
else
{
loader.addFile(new AnimationJSONFile(key, url, loader.path, xhrSettings));
}
// For method chaining
return loader;
};
module.exports = AnimationJSONFile;