3

I am trying to add my saved tilemap to my swift project but unfortunately it doesn't work out for me. I have done these things 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 so far:

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've checked my file name and yes, it's tilemap.tmx so no typo errors. I can run my project but nothing appears. I get this message in my console though:

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 appreciate any kind of help

4
  • You need to make sure the map's assets have the same path in relation to the tmx file as when you created the map.
    – sangony
    May 21, 2015 at 15:58
  • Thanks alot! I am still getting that same message in console, but my tilemap is shown on project start!
    – toom4ny
    May 21, 2015 at 16:10
  • So you worked it out?
    – sangony
    May 21, 2015 at 17:06
  • I have asked another question about converting the tiles to spritenodes, if you have an idea of how to do that I would be glad if you could help me :) The question is here: stackoverflow.com/questions/30379805/…
    – toom4ny
    May 21, 2015 at 17:11

1 Answer 1

2

You need to make sure the map's assets have the same path in relation to the tmx file (map) as when you created the map.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.