Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Drawing Tile Map: 1 Pixel Between Tiles  (Read 2586 times)

0 Members and 1 Guest are viewing this topic.

Charlie

  • Newbie
  • *
  • Posts: 10
    • View Profile
Drawing Tile Map: 1 Pixel Between Tiles
« 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]

TricksterGuy

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Drawing Tile Map: 1 Pixel Between Tiles
« Reply #1 on: June 15, 2011, 04:54:39 am »
It may be caused by the smooth filter

Try image.SetSmooth(false)

Charlie

  • Newbie
  • *
  • Posts: 10
    • View Profile
Drawing Tile Map: 1 Pixel Between Tiles
« Reply #2 on: June 15, 2011, 04:56:29 am »
Thanks! That was the problem.