Namespace for predefined shapes. More...
Functions | |
| sf::Shape | RoundedRect (sf::Vector2f leftUpperPosition, sf::Vector2f size, float cornerRadius, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color(0, 0, 0)) |
| Creates a rectangle with radiused corners. | |
| sf::Shape | RoundedRect (float left, float top, float width, float height, float cornerRadius, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color(0, 0, 0)) |
| Creates a rectangle with radiused corners. | |
| sf::Shape | Polygon (unsigned int nbPoints, sf::Vector2f center, float radius, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color(0, 0, 0)) |
| Creates a regular, convex polygon shape. | |
| ConcaveShape | Star (unsigned int nbStarPoints, sf::Vector2f center, float innerRadius, float outerRadius, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color(0, 0, 0)) |
| Creates a regular star shape. | |
| ConcaveShape | Pie (sf::Vector2f center, float radius, float filledAngle, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color(0, 0, 0)) |
| Creates a pie (a sector of a circle). | |
Namespace for predefined shapes.
This namespace contains some functions to create predefined shapes like stars or rounded rectangles. The namespace Shapes can be considered an extension to the sf::Shape's static factory functions.
| ConcaveShape thor::Shapes::Pie | ( | sf::Vector2f | center, |
| float | radius, | ||
| float | filledAngle, | ||
| const sf::Color & | fillColor, | ||
| float | outlineThickness = 0.f, |
||
| const sf::Color & | outlineColor = sf::Color(0, 0, 0) |
||
| ) |
Creates a pie (a sector of a circle).
| center | The position of the circle's center. |
| radius | Radius of the circle. |
| filledAngle | The part of the circle which is filled (angle in degrees). The value doesn't have to be inside [0,360[. |
| fillColor | The color which is used to fill the star. |
| outlineThickness | The thickness of the outline. |
| outlineColor | The color used for the outline. |
| sf::Shape thor::Shapes::Polygon | ( | unsigned int | nbPoints, |
| sf::Vector2f | center, | ||
| float | radius, | ||
| const sf::Color & | fillColor, | ||
| float | outlineThickness = 0.f, |
||
| const sf::Color & | outlineColor = sf::Color(0, 0, 0) |
||
| ) |
Creates a regular, convex polygon shape.
| nbPoints | The number of polygon points (the smallest possible value is 3 for a triangle). |
| center | The position of the star's center. |
| radius | The distance from the center to the points (> 0.f). |
| fillColor | The color which is used to fill the inside of the polygon. |
| outlineThickness | The thickness of the outline. |
| outlineColor | The color used for the outline. |
| sf::Shape thor::Shapes::RoundedRect | ( | sf::Vector2f | leftUpperPosition, |
| sf::Vector2f | size, | ||
| float | cornerRadius, | ||
| const sf::Color & | fillColor, | ||
| float | outlineThickness = 0.f, |
||
| const sf::Color & | outlineColor = sf::Color(0, 0, 0) |
||
| ) |
Creates a rectangle with radiused corners.
| leftUpperPosition | The left-upper position (of a virtual surrounding rectangle with sharp corners). |
| size | Width and height of the rectangle. |
| cornerRadius | The radius of the circle at the corners. |
| fillColor | The rounded rectangle's fill color. |
| outlineThickness | The thickness of the outline. |
| outlineColor | Color used for the outline. |
| sf::Shape thor::Shapes::RoundedRect | ( | float | left, |
| float | top, | ||
| float | width, | ||
| float | height, | ||
| float | cornerRadius, | ||
| const sf::Color & | fillColor, | ||
| float | outlineThickness = 0.f, |
||
| const sf::Color & | outlineColor = sf::Color(0, 0, 0) |
||
| ) |
Creates a rectangle with radiused corners.
| left,top | The left-upper position (of a virtual surrounding rectangle with sharp corners). |
| width,height | Width and height of the rectangle. |
| cornerRadius | the radius of the circle at the corners. |
| fillColor | The rounded rectangle's fill color. |
| outlineThickness | The thickness of the outline. |
| outlineColor | Color used for the outline. |
| ConcaveShape thor::Shapes::Star | ( | unsigned int | nbStarPoints, |
| sf::Vector2f | center, | ||
| float | innerRadius, | ||
| float | outerRadius, | ||
| const sf::Color & | fillColor, | ||
| float | outlineThickness = 0.f, |
||
| const sf::Color & | outlineColor = sf::Color(0, 0, 0) |
||
| ) |
Creates a regular star shape.
| nbStarPoints | The number of points (the smallest possible is a 3-pointed star). |
| center | The position of the star's center. |
| innerRadius | The distance from the center to the inner points (> 0.f). |
| outerRadius | The distance from the inner points to the outer points (> 0.f). |
| fillColor | The color which is used to fill the star. |
| outlineThickness | The thickness of the outline. |
| outlineColor | The color used for the outline. |