mirror of
https://github.com/wassname/phaser.git
synced 2026-08-02 13:00:25 +08:00
Sprite Sheets now parse and render correctly too.
This commit is contained in:
+2
-1
@@ -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);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user