Chaosus Posted February 20, 2014 Share Posted February 20, 2014 Hi, I don't know if anyone has the same problem here but it's very strange, whenever I want to create a map from the tileset, there is only the first line of the tileset that can be show. But this issue is only for some tileset, which makes it even more weird. Here's a screen of the difference in Tiled map editor and "in game" : http://www.hapshack.com/images/cpWf9.png Any idea where this could come from ? A bug in the JSON file or in the parsing of the JSON file ? Thanks. Link to comment Share on other sites More sharing options...
jcs Posted February 20, 2014 Share Posted February 20, 2014 possibly. it looks like the entire line is being picked up as if it is a single tile. but it's hard to say without knowing more. have you tried debugging it and seeing what tiles Phaser creates? Link to comment Share on other sites More sharing options...
Chaosus Posted February 20, 2014 Author Share Posted February 20, 2014 No it's separate Tiles, i just picked up the whole thing to show what tiles are displayed and what tiles ain't. What do you mean by debugging ? How do I do such a thing ? Thanks for answering btw. Link to comment Share on other sites More sharing options...
rich Posted February 20, 2014 Share Posted February 20, 2014 Post the tileset + json file if you can (or just the tmx + tileset would do). Link to comment Share on other sites More sharing options...
Chaosus Posted February 20, 2014 Author Share Posted February 20, 2014 Alright, here are the .tmx, the .json and the tileset : https://www.dropbox.com/s/1gqifm83g0lh36v/level1.json https://www.dropbox.com/s/1t87rav0ob574d9/level1.tmx Link to comment Share on other sites More sharing options...
rich Posted February 21, 2014 Share Posted February 21, 2014 Ok I've had a look at this and it's because your tileset doesn't fit into the tile size you specified in Tiled. Your original image was 273 x 317 but you said the tiles were 16x16 in size. That doesn't divide equally (273 / 16 = 17.0625) in either direction. Phaser uses the tile sizes + png dimensions to calculate where to cut the tiles from, to save having to work it out for every single tile, every frame. In short, fix your png and it'll work fine. Example attached. AlexArroyoDuque 1 Link to comment Share on other sites More sharing options...
Chaosus Posted February 21, 2014 Author Share Posted February 21, 2014 Well thanks. This is good to know, I'm surprised that I'm the first one to deal with it. I had the same issue with another FrameWork "CanvasEngine" and I dropped it because i couldn't figure out the problem. Anyway now this is solved ! Link to comment Share on other sites More sharing options...
rich Posted February 21, 2014 Share Posted February 21, 2014 You're not the first, I've seen this a couple of times now Link to comment Share on other sites More sharing options...
Recommended Posts