Jump to content

Tilemaps - only the TilesetImage with the "firstgid":1 is shown - others are ignored


valueerror
 Share

Recommended Posts

just for reference..  i did it in the same way it is shown in the wip example "tilemap1" (and the problem is also seen there)  

 

several images are used in the json file and properly set in the code but only the one with the internal id 1 is shown in the game..  all the others are ignored..  

btw.  it is not shown but i can collide with it -  very hard game that way ^^

 

if i go to "tiled" (the mapcreator software) and rearrange my tilesets.. (move another one of the tilesets to the first place so it gets id 1) then another part of my map will be shown.. i can reproduce it anytime..

 

 

here is my code:

game.load.tilemap('pipes', 'pipes.json', null, Phaser.Tilemap.TILED_JSON);game.load.image('pipe', 'tilesets/pipe.png');game.load.image('paddle-ice-flat', 'tilesets/paddle-ice-flat.png');
 
map = game.add.tilemap('pipes'); map.addTilesetImage('pipe');map.addTilesetImage('paddle-ice-flat');layermain = map.createLayer('mainlayer');map.generateCollisionData(layermain);

here an excerpt of the json file...

[...]"tilesets":[        {         "firstgid":1,         "image":"tilesets\/paddle-ice-flat.png",         "imageheight":32,         "imagewidth":192,         "margin":0,         "name":"paddle-ice-flat",         "properties":            {            },         "spacing":0,         "tileheight":32,         "tilewidth":32        },        {         "firstgid":37,         "image":"tilesets\/pipe.png",         "imageheight":192,         "imagewidth":128,         "margin":0,         "name":"pipe",         "properties":            {            },         "spacing":0,         "tileheight":32,         "tilewidth":32        }, [...]

thx

 

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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