0
votes

I am loading a TMX tile map into sprite kit using JSTileMap and the issue I am having is that if I use a tileSet.png the tiles appear too big when displayed. If I use a [email protected] the tiles appear the correct size but my tmx map does not show correctly instead all I see is the tileSet in a grid. I have tried renaming the [email protected] to tileSet.png but once again the tiles appear too big.

Can I use a [email protected] with JSTileMap?

The tiles in both png files are 128x128

Any help is appreciated.

1

1 Answers

0
votes

It sounds like the tile size in your TMX map is set to points, not pixels. Open your TMX map file in a text editor and check to make sure all the numbers are in pixels, not points.

Here is an example of some of the XML you will see.

<map version="1.0" orientation="orthogonal" width="78" height="30" tilewidth="16" tileheight="16">
 <tileset firstgid="1" name="Peacesong_smallProps" tilewidth="16" tileheight="16">
  <image source="Peacesong_smallProps.png" width="208" height="128"/>
 </tileset>
 <tileset firstgid="105" name="Peacesong_mediumProps" tilewidth="32" tileheight="32">
  <image source="Peacesong_mediumProps.png" width="96" height="64"/>
 </tileset>
 <tileset firstgid="111" name="Peacesong_largeProps" tilewidth="48" tileheight="48">
  <image source="Peacesong_largeProps.png" width="384" height="96"/>
 </tileset>
...
</map>

If you are sure this is not the problem, please submit an issue on github here and I'll take a look.