SFML community forums

Help => Graphics => Topic started by: Charlie on June 15, 2011, 04:38:40 am

Title: Drawing Tile Map: 1 Pixel Between Tiles
Post by: Charlie on June 15, 2011, 04:38:40 am
In other languages I have used, this is the code I use to draw a tile map.
When I use the code below it causes a "grid" to be drawn because there is a one pixel boundary between each image. Why is it doing this?

Code: [Select]

//Draw Grass Tiles
for (int y=0;y<SCREEN_HEIGHT / TILE_SIZE;y++)
{
for (int x=0;x<SCREEN_WIDTH / TILE_SIZE;x++)
{
Sprite.SetPosition(x * TILE_SIZE, y * TILE_SIZE);
App.Draw(Sprite);
}
}
[/code]
Title: Drawing Tile Map: 1 Pixel Between Tiles
Post by: TricksterGuy on June 15, 2011, 04:54:39 am
It may be caused by the smooth filter

Try image.SetSmooth(false)
Title: Drawing Tile Map: 1 Pixel Between Tiles
Post by: Charlie on June 15, 2011, 04:56:29 am
Thanks! That was the problem.