Rect.h File Reference

#include <SFML/Config.h>

Go to the source code of this file.


Data Structures

struct  sfFloatRect
 sfFloatRect and sfIntRect are utility classes for manipulating rectangles. More...
struct  sfIntRect

Functions

CSFML_API void sfFloatRect_Offset (sfFloatRect *Rect, float OffsetX, float OffsetY)
 Move a rectangle by the given offset.
CSFML_API void sfIntRect_Offset (sfIntRect *Rect, int OffsetX, int OffsetY)
CSFML_API sfBool sfFloatRect_Contains (sfFloatRect *Rect, float X, float Y)
 Check if a point is inside a rectangle's area.
CSFML_API sfBool sfIntRect_Contains (sfIntRect *Rect, int X, int Y)
CSFML_API sfBool sfFloatRect_Intersects (sfFloatRect *Rect1, sfFloatRect *Rect2, sfFloatRect *OverlappingRect)
 Check intersection between two rectangles.
CSFML_API sfBool sfIntRect_Intersects (sfIntRect *Rect1, sfIntRect *Rect2, sfIntRect *OverlappingRect)

Function Documentation

CSFML_API sfBool sfFloatRect_Contains ( sfFloatRect Rect,
float  X,
float  Y 
)

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

Parameters:
Rect : Rectangle to test
X : X coordinate of the point to test
Y : Y coordinate of the point to test
Returns:
sfTrue if the point is inside

CSFML_API sfBool sfFloatRect_Intersects ( sfFloatRect Rect1,
sfFloatRect Rect2,
sfFloatRect OverlappingRect 
)

Check intersection between two rectangles.

Parameters:
Rect1 : First rectangle to test
Rect2 : Second rectangle to test
OverlappingRect : Rectangle to be filled with overlapping rect (can be NULL)
Returns:
sfTrue if rectangles overlap

CSFML_API void sfFloatRect_Offset ( sfFloatRect Rect,
float  OffsetX,
float  OffsetY 
)

Move a rectangle by the given offset.

Parameters:
Rect : Rectangle to move
OffsetX : Horizontal offset
OffsetY : Vertical offset

CSFML_API sfBool sfIntRect_Contains ( sfIntRect Rect,
int  X,
int  Y 
)

CSFML_API sfBool sfIntRect_Intersects ( sfIntRect Rect1,
sfIntRect Rect2,
sfIntRect OverlappingRect 
)

CSFML_API void sfIntRect_Offset ( sfIntRect Rect,
int  OffsetX,
int  OffsetY 
)