Namespace for predefined shapes. More...
Functions | |
sf::ConvexShape | ToConvexShape (const sf::Shape &shape) |
Converts a specific shape to a general, convex SFML shape. | |
sf::ConvexShape | Line (sf::Vector2f direction, const sf::Color &color, float thickness=1.f) |
Creates a rectangle with radiused corners. | |
sf::ConvexShape | RoundedRect (sf::Vector2f size, float cornerRadius, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color()) |
Creates a rectangle with radiused corners. | |
sf::ConvexShape | Polygon (unsigned int nbPoints, float radius, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color()) |
Creates a regular, convex polygon shape. | |
sf::ConvexShape | Star (unsigned int nbStarPoints, float innerRadius, float outerRadius, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color()) |
Creates a regular star shape. | |
ConcaveShape | Pie (float radius, float filledAngle, const sf::Color &fillColor, float outlineThickness=0.f, const sf::Color &outlineColor=sf::Color()) |
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 specific SFML shape classes like sf::CircleShape or sf::RectangleShape.
sf::ConvexShape thor::Shapes::Line | ( | sf::Vector2f | direction, |
const sf::Color & | color, | ||
float | thickness = 1.f |
||
) |
Creates a rectangle with radiused corners.
direction | Line direction. |
thickness | Line thickness (> 0.f). |
color | Color of the line. |
ConcaveShape thor::Shapes::Pie | ( | float | radius, |
float | filledAngle, | ||
const sf::Color & | fillColor, | ||
float | outlineThickness = 0.f , |
||
const sf::Color & | outlineColor = sf::Color() |
||
) |
Creates a pie (a sector of a circle).
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 pie. |
outlineThickness | The thickness of the outline. |
outlineColor | The color used for the outline. |
sf::ConvexShape thor::Shapes::Polygon | ( | unsigned int | nbPoints, |
float | radius, | ||
const sf::Color & | fillColor, | ||
float | outlineThickness = 0.f , |
||
const sf::Color & | outlineColor = sf::Color() |
||
) |
Creates a regular, convex polygon shape.
nbPoints | The number of polygon points (the smallest possible value is 3 for a triangle). |
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::ConvexShape thor::Shapes::RoundedRect | ( | sf::Vector2f | size, |
float | cornerRadius, | ||
const sf::Color & | fillColor, | ||
float | outlineThickness = 0.f , |
||
const sf::Color & | outlineColor = sf::Color() |
||
) |
Creates a rectangle with radiused 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::ConvexShape thor::Shapes::Star | ( | unsigned int | nbStarPoints, |
float | innerRadius, | ||
float | outerRadius, | ||
const sf::Color & | fillColor, | ||
float | outlineThickness = 0.f , |
||
const sf::Color & | outlineColor = sf::Color() |
||
) |
Creates a regular star shape.
nbStarPoints | The number of points (the smallest possible is a 3-pointed star). |
innerRadius | The distance from the center to the inner points (> 0.f). |
outerRadius | The distance from the center to the outer points (> innerRadius). |
fillColor | The color which is used to fill the star. |
outlineThickness | The thickness of the outline. |
outlineColor | The color used for the outline. |
sf::ConvexShape thor::Shapes::ToConvexShape | ( | const sf::Shape & | shape | ) |
Converts a specific shape to a general, convex SFML shape.