Rect

Functions

bool sfFloatRect_contains(const sfFloatRect *rect, sfVector2f point)

Check if a point is inside a rectangle’s area.

Parameters:
  • rect – Rectangle to test

  • point – Coordinates of the point to test

Returns:

true if the point is inside

bool sfIntRect_contains(const sfIntRect *rect, sfVector2i point)
bool sfFloatRect_intersects(const sfFloatRect *rect1, const sfFloatRect *rect2, sfFloatRect *intersection)

Check intersection between two rectangles.

Parameters:
  • rect1 – First rectangle to test

  • rect2 – Second rectangle to test

  • intersection – Rectangle to be filled with overlapping rect (can be NULL)

Returns:

true if rectangles overlap

bool sfIntRect_intersects(const sfIntRect *rect1, const sfIntRect *rect2, sfIntRect *intersection)
struct sfFloatRect
#include <Rect.h>

sfFloatRect and sfIntRect are utility classes for manipulating rectangles.

Public Members

sfVector2f position
sfVector2f size
struct sfIntRect

Public Members

sfVector2i position
sfVector2i size