Loader can now parse both JSON Hash and JSON Array formated texture atlas files.

This commit is contained in:
Richard Davey
2013-08-29 22:53:55 +01:00
parent 5b036557c0
commit 4c1dacfa02
10 changed files with 205 additions and 50 deletions
+4
View File
@@ -88,6 +88,10 @@ Phaser.Cache.prototype = {
{
this._images[key].frameData = Phaser.Animation.Parser.JSONData(this.game, atlasData);
}
else if (format == Phaser.Loader.TEXTURE_ATLAS_JSON_HASH)
{
this._images[key].frameData = Phaser.Animation.Parser.JSONDataHash(this.game, atlasData);
}
else if (format == Phaser.Loader.TEXTURE_ATLAS_XML_STARLING)
{
this._images[key].frameData = Phaser.Animation.Parser.XMLData(this.game, atlasData, format);
+1 -1
View File
@@ -217,7 +217,7 @@ Phaser.Loader.prototype = {
},
atlasJSON: function (key, textureURL, atlasURL, atlasData) {
atlasJSONArray: function (key, textureURL, atlasURL, atlasData) {
if (typeof atlasURL === "undefined") { atlasURL = null; }
if (typeof atlasData === "undefined") { atlasData = null; }
this.atlas(key, textureURL, atlasURL, atlasData, Phaser.Loader.TEXTURE_ATLAS_JSON_ARRAY);