If you want to hard code values for different resolutions into your game you'll get quite some headaches. It's way better to change things dynamically and only relative to the current window size, so you don't have care what the user does (or at least you could force a minimum window size), but everything will get applied automatically. ;)
Wish I had your knowledge. Which SFML commands should I use to change screen size dynamically?
If I use:
App.create(sf::VideoMode(1024, 768, 32), "My Title", !sf::Style::Resize | sf::Style::Close);
sf::Texture Table;
sf::Sprite spr_CrapTable;
if(!Table.loadFromFile("Images/Table1024x768.png"))
{
return;
}
App.clear(); //Is this necessary? Works without this line but good form to use it?
App.draw(spr_CrapTable);
App.display();
Would I use some sort of resize command to make the SFML window frame and CrapTable smaller prior to the draw and display commands?
If so, could you please tell me how to do the resize? I've been searching "resize" and don't know if I need to use a view, or sprite scale, or what.
Thanks,
Raptor
Hi eXpl0it3r,
I think I "might" have found the command I can use to resize the SFML window:
App.setSize(sf::Vector2u(width, height));
This resizes (stretches/shrinks) the crap table image and the SFML frame around the image. I'll use your suggestion to use about 3 different size .png images to retain decent image quality to cover small to large screen sizes.
But I still don't know what the "maximum" size image to use so that the SFML window frame fits on a 1024x768 screen less the Windows taskbar at the bottom. If anyone knows this, please let me know.
Thanks for always helping out,
Raptor