mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
Tilemap.addTilesetImage will now raise a console.warn if you specify an invalid tileset key and not create the tileset rather than pick the default set.
This commit is contained in:
parent
348e3c14bd
commit
e9436293a8
2 changed files with 13 additions and 0 deletions
|
@ -81,6 +81,7 @@ Version 2.0.4 - "Mos Shirare" - in development
|
|||
* Input and Pointer now use the new ArrayList instead of a LinkedList, which resolve list item removable during callback issues.
|
||||
* Input.reset no longer resets every interactive item it knows of, because they are removed during the destroy phase and can now persist between States if needed.
|
||||
* Blank Tilemaps no longer create `null` tiles, but instead create Tile objects with an index of -1 which can be replaced and updated like any other tile.
|
||||
* Tilemap.addTilesetImage will now raise a console.warn if you specify an invalid tileset key and not create the tileset rather than pick the default set.
|
||||
|
||||
|
||||
### New Features
|
||||
|
|
|
@ -246,6 +246,12 @@ Phaser.Tilemap.prototype = {
|
|||
if (typeof tileset === 'string')
|
||||
{
|
||||
key = tileset;
|
||||
|
||||
if (!this.game.cache.checkImageKey(key))
|
||||
{
|
||||
console.warn('Phaser.Tilemap.addTilesetImage: Invalid image key given: "' + key + '"');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -256,6 +262,12 @@ Phaser.Tilemap.prototype = {
|
|||
if (typeof tileset === 'string')
|
||||
{
|
||||
tileset = this.getTilesetIndex(tileset);
|
||||
|
||||
if (tileset === null)
|
||||
{
|
||||
console.warn('Phaser.Tilemap.addTilesetImage: No data found in the JSON matching the tileset name: "' + key + '"');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.tilesets[tileset])
|
||||
|
|
Loading…
Reference in a new issue