Hey this is how I do it ( I Put it into the events code block)
case sf::Keyboard::F12:
{
sf::Image screen = window.capture();
srand(time(0));
long double randomNum = 0;
for(int i = 0; i < 5; i++)
{
randomNum = rand() % 125000000 + 1;
}
string fileName = "Screenshots\\" + std::to_string(randomNum) + ".png";
screen.saveToFile(fileName);
break;
}
I am using a randum num generator for the names of the screens... you dont need to do that