SFML community forums

Help => Graphics => Topic started by: Chuckleluck on December 14, 2011, 07:20:05 pm

Title: How to use Intersects()?
Post by: Chuckleluck on December 14, 2011, 07:20:05 pm
Hello, I'm fairly new to programming, and the documentation for the `Intersects()' method, part of sf::Rect, confuses me.

This is the code I wrote:
Code: [Select]
if(Intersects(rcBoxA, rcBoxB))
     return true;

(Both boxes are of type sf::Rect<int>)
This is the error I received:
"Error: `Intersects' undeclared (first use this function"

How do I correctly use `Intersects()'?
Title: How to use Intersects()?
Post by: Laurent on December 14, 2011, 07:31:06 pm
Intersects is a member function of class sf::Rect.

Code: [Select]
if (rcBoxA.Intersects(rcBoxB))
    return true;