Sprite Sheets now parse and render correctly too.

This commit is contained in:
Richard Davey
2013-08-30 02:18:00 +01:00
parent 1e59bc69fb
commit a81a8effb4
11 changed files with 92 additions and 31 deletions
+2 -1
View File
@@ -69,10 +69,11 @@ Phaser.Cache.prototype = {
addSpriteSheet: function (key, url, data, frameWidth, frameHeight, frameMax) {
this._images[key] = { url: url, data: data, spriteSheet: true, frameWidth: frameWidth, frameHeight: frameHeight };
this._images[key].frameData = Phaser.Animation.Parser.spriteSheet(this.game, key, frameWidth, frameHeight, frameMax);
PIXI.BaseTextureCache[key] = new PIXI.BaseTexture(data);
this._images[key].frameData = Phaser.Animation.Parser.spriteSheet(this.game, key, frameWidth, frameHeight, frameMax);
},
/**
+6 -3
View File
@@ -177,7 +177,8 @@ Phaser.Loader.prototype = {
if (typeof overwrite === "undefined") { overwrite = false; }
if (overwrite || this.checkKeyExists(key) == false) {
if (overwrite || this.checkKeyExists(key) == false)
{
this.addToFileList('text', key, url);
}
@@ -195,7 +196,8 @@ Phaser.Loader.prototype = {
if (typeof frameMax === "undefined") { frameMax = -1; }
if (this.checkKeyExists(key) === false) {
if (this.checkKeyExists(key) === false)
{
this.addToFileList('spritesheet', key, url, { frameWidth: frameWidth, frameHeight: frameHeight, frameMax: frameMax });
}
@@ -211,7 +213,8 @@ Phaser.Loader.prototype = {
if (typeof autoDecode === "undefined") { autoDecode = true; }
if (this.checkKeyExists(key) === false) {
if (this.checkKeyExists(key) === false)
{
this.addToFileList('audio', key, urls, { buffer: null, autoDecode: autoDecode });
}