Hi, I am simply trying to click and drag a simple square. The following code compiles, but doesn't seem to work at all. The problem code:
if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) {
if (square.getGlobalBounds().contains(sf::Mouse::getPosition().x, sf::Mouse::getPosition().y)) {
std::cout << "you good dude" << std::endl;
square.setPosition(sf::Mouse::getPosition().x, sf::Mouse::getPosition().y);
}
}
cout doesn't output anything to the console, so i know that it has to be an issue with the first if statement, but I do not know any alternatives. Thank you for your time!