Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to use Intersects()?  (Read 1568 times)

0 Members and 1 Guest are viewing this topic.

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
How to use Intersects()?
« 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()'?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How to use Intersects()?
« Reply #1 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;
Laurent Gomila - SFML developer

 

anything