0

I'm making a new Android Game with LibGDX, a platformer but I'm having issues with TMX (Tiled) maps. I read a lot about tiles gaps problems with LibGDX but I can't make it work well.

Here is my problem: sometimes, when the character moves, I can see for on each tiles the end of the previous tile on the Tileset, in full screen on my computer it works well most of the time, but when I set the size of the window to the resolution of my smartphone (800x480px) that won't work.

Here's a video of this problem: https://www.youtube.com/watch?v=IXaoE_YNpuA&list=UUE3Ty03UMwTh3hNIKx2Dmmw

And here's my tileset: enter image description here

Have you got an idea about what can solve this problem ?

1 Answers1

0

This is because of the blending that happens when you're scaling down the image (or rendering it at sub-pixel positions). To avoid it, you can add a 2-pixel spacing between your tiles and make sure the pixels in this space match the colour of the neighbouring tile edges.

Alternatively, try to disable the blending, but I can't tell you how to do that in LibGDX.

Thorbjørn Lindeijer
  • 2,022
  • 1
  • 17
  • 22
  • So, I have to add padding to my tiles, that's a solution that I already tried, but let's try again maybe I made a mistake. The problem is, how to tell Tiled that my tileset has a 2px tile padding ? –  Jul 26 '14 at 20:08
  • @Claymeuns When you're in the "New Tileset" dialog in Tiled, put a value of 2 in the "Spacing" field. – Thorbjørn Lindeijer Jul 28 '14 at 13:09