How can I avoid lines between tiles after I modify the scale of TileMap?


#1

I have attached the screenshot. What can I do?


未命名.PNG (48.4 KB)


Hello, I have a question about scale!
#2

This is normal.
The SpriteSheet has been created this way (it’s from one of Ray’s tutorials, right?), so that there is some padding btw tiles.
When loading the sprites, you must specify the padding value, everything is described in the tutorial.


#3

Thanks a lot, I will try it soon. Hope it can help me. :slight_smile:


#4

I find the anwser in the wiki of cocos2d-iphone at last. Also thanks for your help.

http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps#how_to_create_external_tilesets

The spritesheet artifact fixer
If you experience lines flickering between the borders of your tiles when you move your map, this tool will fix that. Please note, these lines don’t appear in the simulator, only on devices.

The spritesheet-artifact-fixer is a little tool that comes with cocos2d that lets you fix your spritesheet.

What it really does, is to copy the borders of your tiles, into the spacing/margin pixels. In theory the spacing/margin pixels should NOT be rendered, but in practice sometimes they are rendered, specially if you use anti-alias textures and a 3D projection.


#5

Thanks Harrison, I have added this thread into the sticky FAQ.