1
Graphics / How to use bounding boxes and points?
« on: May 01, 2015, 11:54:19 pm »
I don't understand the syntax, please correct me. I want to check if a sprite contains a point. and YeS I have read the forums and looked on the wiki.
sf::RectangleShape sprite1box = sprite1.getGlobalBounds();
sf::Vector2f point = (-50, -20);
if (sprite1box.contains(point))
{
window.close();
}
sf::RectangleShape sprite1box = sprite1.getGlobalBounds();
sf::Vector2f point = (-50, -20);
if (sprite1box.contains(point))
{
window.close();
}