The position of the sprite won't change, the only thing that does change are the properties of the window and its connected view, which will stretch the sprites.
A quick search on 'resize' would've probably answered your question (hint: this link (http://) leads you to the search function). ;)
I myself use something like this to adjust the window size and to preserve a minimum size:
if(event.type == sf::Event::Resized)
{
sf::Vector2f size = static_cast<sf::Vector2f>(mWindow.getSize());
// Minimum size
if(size.x < 800)
size.x = 800;
if(size.y < 600)
size.y = 600;
view.setCenter(size/2.f);
view.setSize(size);
window.setSize(static_cast<sf::Vector2<unsigned int> >(size));
window.setView(sf::View(sf::FloatRect(0.f, 0.f, size.x, size.y)));
}
The position of the sprite won't change, the only thing that does change are the properties of the window and its connected view, which will stretch the sprites.
A quick search on 'resize' would've probably answered your question (hint: this link (http://) leads you to the search function). ;)
I myself use something like this to adjust the window size and to preserve a minimum size:
if(event.type == sf::Event::Resized)
{
sf::Vector2f size = static_cast<sf::Vector2f>(mWindow.getSize());
// Minimum size
if(size.x < 800)
size.x = 800;
if(size.y < 600)
size.y = 600;
view.setCenter(size/2.f);
view.setSize(size);
window.setSize(static_cast<sf::Vector2<unsigned int> >(size));
window.setView(sf::View(sf::FloatRect(0.f, 0.f, size.x, size.y)));
}
You know out of all the times I used the search function, I never once thought of using it for this... -_-
You mentioned it would stretch the sprites, Thought, I suppose you could check the window size and if its resized below or above certain points, you could probably load a more high res image as the sprite? Or is there a simpler way. I just think using the normal resize might take a bit more cpu and have less quality than loading multiple images but I may be wrong, I have been before.