Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Tileset : only the first line displayed


Chaosus
 Share

Recommended Posts

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

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.

 

post-1-0-30689000-1392975523.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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