Jump to content

Phaser tilemap Image Layer !?


Recommended Posts

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,


Link to comment
Share on other sites

  • 2 weeks later...

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...