Recommended margin and spacing for tilesource? (SOLVED)

Hi Karl! It should be enough to set extrude borders to 1 and leave margin and inner padding to 0. Our own documentation mentions this for Extrude Borders:

“A good measure is to specify a number that corresponds to how much you scale the textures when viewed in game. If you display the game world at half scale (you can see 2 times as much) then set Extrude Borders to 2. When the texture is used scaled down to half the size, a mipmap is used for rendering. That mipmap is half the width and height of the original image.”

To be honest, I was actually a bit uncertain about the use of inner padding and margin, but since I assume these values have the same purpose and meaning as in TexturePacker I took a look at the documentation there:

Inner Padding

Adds transparent pixels to the inside of the sprite, growing it.

There are two uses for this:

  • It can help in preventing cut-off artifacts near the edges of scaled sprites. E.g. if your sprite has a few pixels along its own boundaries, scaling the sprite up or down won’t let these pixels appear as gaps or cuts.
  • It considerably reduces aliasing along the polygon edges when rotating trimmed or cropped sprites. E.g. if your sprite has many pixels along its own boundaries, it will be drawn more smoothly when rotating it.

Margins

Note: I’m assuming Margin is the same as TexturePackers shape padding setting:

Shape padding is the space between sprites. Value adds transparent pixels between sprites to avoid artifacts from neighbor sprites. The transparent pixels are not added to the sprites. Default is 2.

Use a value of at least 2 to avoid dragging in pixels from neighbor sprites when using OpenGL rendering.

@sicher: We should clarify the use of Margins and Inner Padding in our documentation

4 Likes