Skip to content

Commit

Permalink
Merge pull request #990 from lucbloom/warn-texture-not-found
Browse files Browse the repository at this point in the history
Warn about missing textures and show the key that the author was trying to use.
  • Loading branch information
photonstorm committed Jul 10, 2014
2 parents 0d0a16e + 3f5bde8 commit 435fab5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gameobjects/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ Phaser.Image.prototype.loadTexture = function (key, frame) {
}
else if (typeof key === 'string' && !this.game.cache.checkImageKey(key))
{
console.warn("Texture with key '" + key + "' not found.");
this.key = '__missing';
this.setTexture(PIXI.TextureCache[this.key]);
}
Expand Down
1 change: 1 addition & 0 deletions src/gameobjects/Sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) {
}
else if (typeof key === 'string' && !this.game.cache.checkImageKey(key))
{
console.warn("Texture with key '" + key + "' not found.");
this.key = '__missing';
this.setTexture(PIXI.TextureCache[this.key]);
}
Expand Down
1 change: 1 addition & 0 deletions src/gameobjects/TileSprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ Phaser.TileSprite.prototype.loadTexture = function (key, frame) {
}
else if (typeof key === 'string' && !this.game.cache.checkImageKey(key))
{
console.warn("Texture with key '" + key + "' not found.");
this.key = '__missing';
this.setTexture(PIXI.TextureCache[this.key]);
}
Expand Down

0 comments on commit 435fab5

Please sign in to comment.