Bromeon
Functions
thor::Shapes Namespace Reference

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).

Detailed Description

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.


Function Documentation

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).

Parameters:
centerThe position of the circle's center.
radiusRadius of the circle.
filledAngleThe part of the circle which is filled (angle in degrees). The value doesn't have to be inside [0,360[.
fillColorThe color which is used to fill the star.
outlineThicknessThe thickness of the outline.
outlineColorThe color used for the outline.
Returns:
A ConcaveShape instance representing the pie.
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.

Parameters:
nbPointsThe number of polygon points (the smallest possible value is 3 for a triangle).
centerThe position of the star's center.
radiusThe distance from the center to the points (> 0.f).
fillColorThe color which is used to fill the inside of the polygon.
outlineThicknessThe thickness of the outline.
outlineColorThe color used for the outline.
Returns:
A sf::Shape copy representing the regular polygon.
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.

Parameters:
leftUpperPositionThe left-upper position (of a virtual surrounding rectangle with sharp corners).
sizeWidth and height of the rectangle.
cornerRadiusThe radius of the circle at the corners.
fillColorThe rounded rectangle's fill color.
outlineThicknessThe thickness of the outline.
outlineColorColor used for the outline.
Returns:
A sf::Shape copy containing the rounded rectangle.
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.

Parameters:
left,topThe left-upper position (of a virtual surrounding rectangle with sharp corners).
width,heightWidth and height of the rectangle.
cornerRadiusthe radius of the circle at the corners.
fillColorThe rounded rectangle's fill color.
outlineThicknessThe thickness of the outline.
outlineColorColor used for the outline.
Returns:
A sf::Shape copy containing the rounded rectangle.
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.

Parameters:
nbStarPointsThe number of points (the smallest possible is a 3-pointed star).
centerThe position of the star's center.
innerRadiusThe distance from the center to the inner points (> 0.f).
outerRadiusThe distance from the inner points to the outer points (> 0.f).
fillColorThe color which is used to fill the star.
outlineThicknessThe thickness of the outline.
outlineColorThe color used for the outline.
Returns:
A ConcaveShape instance representing the star.