Concave shape class. More...
Public Member Functions | |
ConcaveShape () | |
Creates an empty shape. | |
ConcaveShape (const sf::Shape &shape) | |
Implicit constructor that adapts an existing sf::Shape. | |
void | Swap (ConcaveShape &other) |
Exchanges the content of two instances in O(1). | |
void | AddPoint (float x, float y, const sf::Color &color, const sf::Color &outlineColor=sf::Color(0, 0, 0)) |
Adds a point to the concave shape. | |
void | AddPoint (sf::Vector2f position, const sf::Color &color, const sf::Color &outlineColor=sf::Color(0, 0, 0)) |
Adds a point to the concave shape. | |
void | SetOutlineThickness (float outlineThickness) |
Sets the thickness of the shape's outline (0.f by default). | |
float | GetOutlineThickness () const |
Returns the shape's outline thickness. | |
Related Functions | |
void | thor::swap (ConcaveShape &lhs, ConcaveShape &rhs) |
Exchanges the contents of two concave shapes. |
Concave shape class.
This class has the same interface and functionality as sf::Shape, but is additionally able to work with shapes that are concave.
Creates an empty shape.
You can use AddPoint() to build your own concave shape.
thor::ConcaveShape::ConcaveShape | ( | const sf::Shape & | shape | ) |
Implicit constructor that adapts an existing sf::Shape.
The concave shape should look as similar as possible to the original sf::Shape, however there may occur small deviations.
void thor::ConcaveShape::AddPoint | ( | float | x, |
float | y, | ||
const sf::Color & | color, | ||
const sf::Color & | outlineColor = sf::Color(0, 0, 0) |
||
) |
void thor::ConcaveShape::AddPoint | ( | sf::Vector2f | position, |
const sf::Color & | color, | ||
const sf::Color & | outlineColor = sf::Color(0, 0, 0) |
||
) |
void thor::ConcaveShape::SetOutlineThickness | ( | float | outlineThickness | ) |
Sets the thickness of the shape's outline (0.f by default).
outlineThickness must be greater or equal to zero. If it is zero, no outline is visible.