RaptorZen64 Posted December 16, 2013 Share Posted December 16, 2013 Hello,I've recently started playing around with Phaser but have ran into a problem. I made my tiled map in Tiled and exported it as JSON. Everything went fine, but the browser will only render the tiles that are in the first row e.g. 1 - 12. As soon as I want to render a tile that is in any other row(13,14,22,66..) it renders a blank space. I've compared my code and JSON data to the examples, and everything seems to be the same, apart from the tile height,width.. Any ides on why It only renders the first row? Thank you. Link to comment Share on other sites More sharing options...
rich Posted December 17, 2013 Share Posted December 17, 2013 Sounds like it could be an issue parsing the tileset - paste the tileset here and that line of code if you can please. Link to comment Share on other sites More sharing options...
RaptorZen64 Posted December 17, 2013 Author Share Posted December 17, 2013 Sounds like it could be an issue parsing the tileset - paste the tileset here and that line of code if you can please.Sure, here's the codegame.load.tilemap('map','art/tiles/level1.json',null,Phaser.Tilemap.TILED_JSON);game.load.tileset('tiles', 'art/tiles/tiles2.png',70,70);...tileset = game.add.tileset('tiles');map = game.add.tilemap('map');layer = game.add.tilemapLayer(0,0,800,600,tileset,map,0);layer.resizeWorld();And here is the tileset, I borrowed it from the opengameart.orghttps://dl.dropboxusercontent.com/u/80186523/art/tiles/tiles2.png Link to comment Share on other sites More sharing options...
rich Posted December 17, 2013 Share Posted December 17, 2013 The issue is that the tileset image doesn't evenly divide up. You've given it a width/height of 70x70 (which is of course correct), but the tiles don't align to a 70x70 grid. The following screen grab should help show what I mean: You need to trim the sheet down. Remove the blank column on the right plus the little extra padding, and remove the excess space from the bottom of the sheet too. In Phaser 1.1.4 (currently in development) there are 2 new tileset values to specify the number of rows and columns to extract, but in the meantime this will resolve it. RaptorZen64, JHardin1112 and Mike 3 Link to comment Share on other sites More sharing options...
RaptorZen64 Posted December 17, 2013 Author Share Posted December 17, 2013 I see, thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts