dystop1a Posted April 1, 2017 Share Posted April 1, 2017 In advance sorry about my lack of reading the documentation! I tried looking at the Phaser Examples and looking around... How to link a "Image Layer" from a JSON tilemap generated from Tiled program? In the "preload" function I have the asset loaded: game.load.image('exit', 'map/exit.png'); Then in "create" function I have tried both: platforms = map.createLayer('exit'); //ERROR - Tilemap.createLayer: Invalid layer ID given: null & platforms = map.addTilesetImage('exit'); //ERROR - Phaser.Tilemap.addTilesetImage: No data found in the JSON matching the tileset name: "exit" Neither works!? map.JSON (i tried moving the exit.png into the route and the image is inside the same folder as the map.JSON file). { "height":130, "layers":[ { "height":0, "image":"exit.png", "name":"exit", "offsetx":3943, "offsety":368, "opacity":1, "type":"imagelayer", "visible":true, "width":0, "x":0, "y":0 }, Link to comment Share on other sites More sharing options...
dystop1a Posted April 5, 2017 Author Share Posted April 5, 2017 Bump anyone? Link to comment Share on other sites More sharing options...
jjwallace Posted April 7, 2017 Share Posted April 7, 2017 Not Atlas? this.load.atlas('spJellyFish', 'assets/sprite/sp_jellyfish.png', 'assets/sprite/sp_jellyfish.json', Phaser.Loader.TEXTURE_ATLAS_JSON_HASH); Link to comment Share on other sites More sharing options...
msickle Posted April 8, 2017 Share Posted April 8, 2017 This example got me started with tile maps. Worked exactly as they do it here. All I did need was a spritesheet to work with at the beginning. I used it in Tiled and then also load into Phaser: https://phaser.io/examples/v2/loader/load-tilemap-json Link to comment Share on other sites More sharing options...
Larzan Posted April 23, 2017 Share Posted April 23, 2017 I have the same problem, it seems to me that loading the Tiled image layer has not been implemented yet... There is a custom plugin that can replace phaser's internal Tiled loading functionality, but they haven't implemented the 'Image Layer' either: https://github.com/englercj/phaser-tiled#why-use-this-plugin So unfortunately you just have to bite the bullet and load the JSON, extract the image information and create the sprites yourself... Link to comment Share on other sites More sharing options...
Recommended Posts