Greetings to the SFML community!
I am new to SFML and game programming in general. I found this excellent tutorial on creating and drawing a tile map. (
http://www.sfml-dev.org/tutorials/2.0/graphics-vertex-array.php) (I plan on going further by loading a tile map from a text file tile index instead of an array, but I plan to tackle that challenge later.)
Right now I'm trying to draw a tile map with transparent regions over a background sprite. I have figured out how to create a color mask to key out background colors, which allows me to use sprite sheets that do not have transparent backgrounds for animated characters; however, I have not figured out how to draw tile maps with transparent regions over a background sprite.
I created four hand-drawn test tiles: three tiles are to be visible on screen, and one is a solid fuchsia color that I intend to key out and make transparent. I have made a simple tile map using the technique from the "Example: Tile Map" section of the aforementioned SFML tutorial. (See link above.) In order to have transparent regions of my tile map, I figure I need to somehow:
1) copy the tile map to an image
2) key out the fuchsia tiles using createMaskFromColor()
3) create a texture from the tile map image
4) create a sprite from the tile map texture
5) and draw the tile map sprite over my background sprite.
I have enough SFML experience to do steps 2-5, but I don't know how to accomplish step 1). Any help with this step would be greatly appreciated! (If you have a better way to accomplish this task, please share it!)
Regards,
-Vitis