I am having difficulties to understand how JSTileMap works with SpriteKit and Tiled.
The problem is related to pixels and points, and also to loading apropriate tileset using JSTileMap based on screen scale factor.
File structure in project
In my project there are files which have following structure and this represents my low-res map (1024x768px with 32x32px tiles):
- folder called SD
- level-1.tmx
- folder tmx-levels-sd.atlasc
- tmx-levels-sd.1.png
- tmx-levels-sd.plist
In this case when I load level-1.tmx on non-retina simulator everything is positioned properly. When I run the same configuration on retina simulator, again, everything is fine but tiles are scaled. Because of that quality suffers. So, how to load high-res tileset when needed?
The other solution
I also tried to solve this by using two versions of the map (low-res and high-res) for each level. That is actually what I was trying to avoid but still is acceptable:
For this situation I have files structured like this (map is 2048x1536 with 64x64px tiles):
- folder called SD
- level-1.tmx
- folder tmx-levels-sd.atlasc
- tmx-levels-sd.1.png
- tmx-levels-sd.plist
- folder called HD
- level-1-hd.tmx
- folder tmx-levels-hd.atlasc
- tmx-levels-hd.1.png
- tmx-levels-hd.plist
I guess that map with size 2048x1536 and doubled tilesize is appropriate for high-res version of my map? Also as you can see, there is no @2x tilesets at all in my project(I guess that we can't use @2x suffix with Tiled editor and JSTileMap?).
Problem with this configuration is that everything is altered(positions and tilesizes are doubled). JSTileMap probably works with points, Tiled with pixels, and above all that there is a known iPad simulator bug related to texture atlases which makes me difficult to understand what causing the problems with high-res map.
Can somebody clarify these things about using JSTileMap,SpriteKit and Tiled altogether ? Thanks!