mirror of
https://github.com/wassname/phaser.git
synced 2026-07-04 17:20:31 +08:00
TilemapParser will now throw a warning if the tileset image isn't the right size for the tile dimensions (fixes #377)
This commit is contained in:
@@ -400,7 +400,14 @@ Phaser.TilemapParser = {
|
||||
newSet.columns = (set.imagewidth - set.margin) / (set.tilewidth + set.spacing);
|
||||
newSet.total = newSet.rows * newSet.columns;
|
||||
|
||||
tilesets.push(newSet);
|
||||
if (newSet.rows % 1 !== 0 || newSet.columns % 1 !== 0)
|
||||
{
|
||||
console.warn('TileSet image dimensions do not match expected dimensions. Tileset width/height must be evenly divisible by Tilemap tile width/height.');
|
||||
}
|
||||
else
|
||||
{
|
||||
tilesets.push(newSet);
|
||||
}
|
||||
}
|
||||
|
||||
map.tilesets = tilesets;
|
||||
|
||||
Reference in New Issue
Block a user