Hello, I'm making a Pong Game, and for this i made a MainMenu gamestate. There's a text for Start Game and one for End Game. Now i made this do change the color of the text if I'm moving my mous over it:
if (txtStartGame.getGlobalBounds().contains(
sf::Mouse::getPosition(game.window).x,
sf::Mouse::getPosition(game.window).y) &&
txtStartGame.getColor() != sf::Color::Green)
{
//changecolor
}
now this works great, but only if I dont change the size of my window. If I change the size of the window, i have to move the mouse on another spot to change the color of the text i want to change.
im making the window like this:
window.create(sf::VideoMode(1280, 720), "Pong");
and the text im making like this:
txtStartGame.setFont(font);
txtStartGame.setString("Start Game");
txtStartGame.setCharacterSize(30);
txtStartGame.setPosition(400.f, 500.f);
So what am I doing wrong ?
(Sorry for my bad English by the way xD)