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

Author Topic: Unwanted, dark grey grid appearing.  (Read 1321 times)

0 Members and 1 Guest are viewing this topic.

GarrickW

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Unwanted, dark grey grid appearing.
« on: July 27, 2011, 09:19:48 am »
This might be an error in my code somewhere, but I can't actually figure out where.  Then again, I might not understand SFML properly yet.

I'm working on a tile-based RTS prototype, and I just made the move from sf::Shape::Rectangles to sf::Sprites for representing my tiles, in order to make them look more interesting.  However, there is now a grey grid that appears in the space between the tiles (see image below).

http://imageshack.us/photo/my-images/33/screenshotgf.jpg/

This shouldn't be happening.  I've got all the tiles spaced at 32 units, which is also the size of the square tiles.  I've tried making the tiles wider in the hopes of "covering" the grid as a temporary solution, but that doesn't work.  The grid appears to exist between the tiles, yet does not go away, even if I inflate the tile size.

I've also placed markers in each of the four corners of the blank tiles, to see if any of the sides or corners are being "covered" by this grid - they're not, unless I inflate the tiles, in which case even the parts that are covered by tiles further to the bottom or right sport this annoying grid.

I thought it might have something to do with the Sprite's Blend, so I set that to None, and nothing changed.

Here is a close-up of the grid, zoomed in using a View.

http://imageshack.us/photo/my-images/32/screenshot2iv.jpg/

As you can see, it cuts off very sharply when two different sorts of tile meet.  I get the impression that SFML is trying to "soften" the contours of my tiles, but I don't want this.  What's up with that?

I should also mention that when I scroll around (again, using a View), the grid tends to flicker, sometimes only appearing vertically, sometimes only horizontally, and sometimes not at all (though only rarely).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Unwanted, dark grey grid appearing.
« Reply #1 on: July 27, 2011, 09:37:21 am »
You should try image.SetSmooth(false) on the image(s) used by your tiles sprites.
Laurent Gomila - SFML developer

GarrickW

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Unwanted, dark grey grid appearing.
« Reply #2 on: July 27, 2011, 11:15:15 am »
Ah, yes, that was exactly it!  Thank you!