1
Graphics / Re: Tile map to image for color masking/transparent tiles
« on: June 26, 2014, 06:47:22 am »
Load your tile map to an image then copy it to a texture with this code:
sf::Image ImageTileMap;
sf::Texture TileMap;
ImageTileMap.loadFromFile("filename");
ImageTileMap.createMaskFromColor(...);
TileMap.update(ImageTileMap);
or you can always convert sf::Texture to sf::Image withsf::Texture TileMap;
ImageTileMap.loadFromFile("filename");
ImageTileMap.createMaskFromColor(...);
TileMap.update(ImageTileMap);
image = texture.copyToImage()
Afterwards, create your tile map class using your texture.