Is there a way to copy only part of an image into another image?
I don't get the copy function.
What is DestX and DestY? is it where the new image will stop copying pixels? If so, then i don't get the IntRect that is also passed and its purpose.
For example, i'm trying to create 3 different images from one image.
I'm setting the DestX and DestY to 0, which is probably wrong.
And then i'm setting the IntRect to the area i want the new image to copy from the image Maps.
Doing this result in an error in my command prompt: "Trying to access the pixels of an empty image"
I will keep trying though.
sf::Image Maps;
Maps.loadFromFile("MapSelect.png");
sf::Image map1;
map1.copy(Maps,0,0,sf::IntRect(0,0,640,360));
sf::Image map2;
map2.copy(Maps,0,0,sf::IntRect(640,0,640,360));
sf::Image map3;
map3.copy(Maps,0,0,sf::IntRect(1280,0,640,360));