CSFML 2.6.1

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

Loading...
Searching...
No Matches
Classes | Functions
Rect.h File Reference
`#include <SFML/Graphics/Export.h>`
`#include <SFML/System/Vector2.h>`

Go to the source code of this file.

## Classes

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

## Functions

sfBool | sfFloatRect_contains (const sfFloatRect *rect, float x, float y)
| Check if a point is inside a rectangle's area.
sfBool | sfIntRect_contains (const sfIntRect *rect, int x, int y)
sfBool | sfFloatRect_intersects (const sfFloatRect *rect1, const sfFloatRect *rect2, sfFloatRect *intersection)
| Check intersection between two rectangles.
sfBool | sfIntRect_intersects (const sfIntRect *rect1, const sfIntRect *rect2, sfIntRect *intersection)
sfVector2f | sfFloatRect_getPosition (const sfFloatRect *rect)
| Get the position of the rectangle's top-left corner.
sfVector2i | sfIntRect_getPosition (const sfIntRect *rect)
sfVector2f | sfFloatRect_getSize (const sfFloatRect *rect)
| Get the size of the rectangle.
sfVector2i | sfIntRect_getSize (const sfIntRect *rect)

## Function Documentation

## ◆ sfFloatRect_contains()

sfBool sfFloatRect_contains | ( | const 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

## ◆ sfFloatRect_getPosition()

sfVector2f sfFloatRect_getPosition | ( | const sfFloatRect * | rect | ) |

Get the position of the rectangle's top-left corner.

Returns
  Position of rectangle

See also
  getSize

## ◆ sfFloatRect_getSize()

sfVector2f sfFloatRect_getSize | ( | const sfFloatRect * | rect | ) |

Get the size of the rectangle.

Returns
  Size of rectangle

See also
  getPosition

## ◆ sfFloatRect_intersects()

sfBool 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
  sfTrue if rectangles overlap

## ◆ sfIntRect_contains()

sfBool sfIntRect_contains | ( | const sfIntRect * | rect,
|  | int | x,
|  | int | y
| ) |  |

## ◆ sfIntRect_getPosition()

sfVector2i sfIntRect_getPosition | ( | const sfIntRect * | rect | ) |

## ◆ sfIntRect_getSize()

sfVector2i sfIntRect_getSize | ( | const sfIntRect * | rect | ) |

## ◆ sfIntRect_intersects()

sfBool sfIntRect_intersects | ( | const sfIntRect * | rect1,
|  | const sfIntRect * | rect2,
|  | sfIntRect * | intersection
| ) |  |