1
Graphics / sf::Sprite FloodFill or Masking?
« on: August 18, 2010, 01:31:35 pm »
In the game I'm writing I need the ability to change parts of a sf::Sprite as if I were using a flood/seed fill algorithm. Before I go on to write that up, is there a way to 'mask' parts of a sf::Sprite with a color based on the sf::Image color?
For example, if I had a map of countries with different greyscale values for each country, does a method exist where I could change the color of a country by picking the greyscale value and masking red (for example) over all pixels of that value.
If not, I suppose it's on to writing a flood/seed fill algorithm or splitting the map into several PNGs with an alpha layer (not excited about the latter idea).
For example, if I had a map of countries with different greyscale values for each country, does a method exist where I could change the color of a country by picking the greyscale value and masking red (for example) over all pixels of that value.
If not, I suppose it's on to writing a flood/seed fill algorithm or splitting the map into several PNGs with an alpha layer (not excited about the latter idea).