Using JSTileMap in Swift

I am trying to add the saved tilemap file to my quick project, but unfortunately it doesn't work for me. I have done this so far:

1. I have imported libz.dylib framework
2. I have a bridging-header file with these two imports:
        #import "JSTileMap.h"
        #import "LFCGzipUtility.h"
3. I have imported JSTileMap files and my tilemap to the project
4. I have imported the tilesets I've used

      

I have this code:

var tileMap = JSTileMap(named: "tilemap.tmx")

override func didMoveToView(view: SKView) {

 self.anchorPoint = CGPoint(x: 0, y: 0)
 tileMap.position = CGPoint(x: 0, y: 0)
 addChild(tileMap)

}

      

I checked the filename and yes it is tilemap.tmx

, so no typo errors. I can run my project but nothing appears. I am getting this message in the console:

2015-05-21 16:38:28.844 PROJECT NAME[7671:507940] SKTexture: Error loading image resource: "PATH-TO-File/spritesheet.png"
2015-05-21 16:38:28.845 PROJECT NAME[7671:507940] texture image: PATH-TO-File/spritesheet.png
Size (128.000000, 128.000000)
2015-05-21 16:38:28.846 PROJECT NAME[7671:507940] SKTexture: Error loading image resource: "PATH-TO-File/backgrounds.png"
2015-05-21 16:38:28.847 PROJECT NAME[7671:507940] texture image: PATH-TO-File/backgrounds.png
Size (128.000000, 128.000000)
2015-05-21 16:38:28.847 PROJECT NAME[7671:507940] Layer Tile Layer 1 has zPosition -20.000000

      

I would be grateful for any help

+3


source to share


1 answer


You need to make sure that the maps have the same path in relation to the tmx file (map) as when creating the map.



+2


source







All Articles