1
votes

I'm trying to make a tile map in libgdx. I have made all the tile images and used TexturePacker2 to pack them. When I load the game, it is rendering the map but using the wrong tiles. It appears to be using column first indexing while Tiled Map Editor is using row first.

For example, my packed tile image is a 5x5 grid. I used the tile at the 3rd row, 5th column (saves as 15) in the editor and then libgdx has used the tile at the 5th row, 3rd column.

What am i doing wrong?

1

1 Answers

2
votes

The indexes in the packfile we all wrong. I'm not sure why they were wrong but I manually corrected them so that the tile in the top left was index: 0 and to the right of that was 1 and so on up to 24 in the bottom right.

My map draws correctly now.