mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
Don't call setTileSize or setSpacing unless values are given
This commit is contained in:
parent
f44b10631d
commit
52085dba91
1 changed files with 10 additions and 2 deletions
|
@ -423,8 +423,16 @@ var Tilemap = new Class({
|
|||
|
||||
if (tileset)
|
||||
{
|
||||
tileset.setTileSize(tileWidth, tileHeight);
|
||||
tileset.setSpacing(tileMargin, tileSpacing);
|
||||
if (tileWidth || tileHeight)
|
||||
{
|
||||
tileset.setTileSize(tileWidth, tileHeight);
|
||||
}
|
||||
|
||||
if (tileMargin || tileSpacing)
|
||||
{
|
||||
tileset.setSpacing(tileMargin, tileSpacing);
|
||||
}
|
||||
|
||||
tileset.setImage(texture);
|
||||
|
||||
return tileset;
|
||||
|
|
Loading…
Reference in a new issue