I tried to chance a text's color when hovering over it with the mouse but it gives me an error:
"error C4996: 'sf::Text::setColor': was declared deprecated"
This is the code:
void textColorRed() {
if (sf::Mouse::getPosition().x > button.getGlobalBounds().left && sf::Mouse::getPosition().x < button.getGlobalBounds().left + button.getGlobalBounds().width)
{
if (sf::Mouse::getPosition().y > button.getGlobalBounds().top && sf::Mouse::getPosition().y < button.getGlobalBounds().top + button.getGlobalBounds().height) {
button.setColor(sf::Color::Red);
}
}
}
Any idea what I did wrong?
PS: The two if's work because I tried to count in the console "1" and it works so I did something wrong with the color I think.