I’m trying to add a tileset to Phaser 3 that I created with Tiled v1.7.1, but am getting the ‘warning’ mentioned in the title, which gives a black screen as the tileset is not loaded properly.
Here’s my preload() method:
this.load.image('tiles','assets/tilemaps/OverworldTilesetImage.png')
this.load.tilemapTiledJSON('map', 'assets/tilemaps/Town.json')
‘tiles’ represents the png of my tileset. The image size is 592 x 464, and the tiles are 16 x 16.
Here is my create() method:
const map = this.add.tilemap('map')
const tileset = map.addTilesetImage('Town', 'tiles', 16, 16)
const backgroundLayer = map.createLayer('Background', tileset)
I get the ‘Image tile area not tile size multiple’ warning on the line that invokes addTilesetImage(). Even though both 592 and 464 are clear multiples of 16.
Am I missing something? The code is an exact copy of the Phaser 3 examples. I have already embedded the tilemap in Tiled before exporting (which was my original error).
Is there at least a way to debug things? Like to see if the ‘tiles’
image is being loaded properly?
------------------------UPDATE-------------------------
I’ve dug deeper to find that my tileset image loading in is in fact 592 x 464.
I can also see in my tilemap JSON that the tileWidth and tileHeight properties are set to 16.
But I do see that in the JSON i exported from Tiled, the ‘width’ and ‘height’ properties are set to 50 and 76, but those are supposed to represent how many tiles wide and high the map is.
Could Phaser be misinterpreting the ‘width’ and ‘height’ as the tileWidth and tileHeight?
Thanks!