SFML community forums
Help => Graphics => Topic started by: slotdev on July 20, 2012, 02:47:53 pm
-
Hi
I have loads of sprites, all derived from large tiles using SetSubRect. Now I need to be able to save to file each of these sprites. I can do a mySprite.getTexture and copy this to an sf::Image...but this is the entire tile for this sprite - not just the data for the small sub-rect.
Any ideas how to achieve this??
Many Thanks
Ed
-
Draw them all to a sf::RenderTexture retrieve the texture, convert to a image and save it. ;)
-
I managed to do it using a temporary sf::Image, copying data from a texture using copyToImage, and then saving it. It works perfectly :)
Thanks!