Hello,
I'm writing a small game, I set up a window and placed some buttons on it. The buttons are sf::sprite objects using an sf::image of a button, some .PNG image file. At this moment, the buttons use a fixed X and Y position. I can click the button and everything works fine.
However, if the window is resized, the buttons stretch out, which is actually what I want to happen. However, the position checking uses the button's SF::image width and height to check for button presses, but these are no longer accurate after they are being resized.
My question is, why are the buttons being stretched? Although I want this to happen I'm not sure what actually causes it right now.
Is this happening automaticly for sf:sprite objects? And how could I solve my problem about the images being scaled, but not the sprite.GetPosition() and GetHeight()?
Do I need to use a virtual screen or something? And if so, what kind of class to I need to use for this virtual screen, another sf::RenderWindow or can I use a sf::image for that purpose?
Greetings,
Rob