|
| RoundedRectangleShape (Vector2f size=Vector2f{ 0.0f, 0.0f }, float radius=0.0f, std::size_t cornerPointCount=8) |
| Default constructor. More...
|
|
| RoundedRectangleShape (const RectF &rect, float radius=0.0f, std::size_t cornerPointCount=8) |
| Constructor with a rectangle. More...
|
|
void | setSize (Vector2f size) |
| Set the size of the rectangle. More...
|
|
Vector2f | getSize () const |
| Get the size of the rectangle. More...
|
|
void | setRadius (float radius) |
| Set the radius of the corner. More...
|
|
float | getRadius () const |
| Get the radius of the corner. More...
|
|
void | setCornerPointCount (std::size_t cornerPointCount) |
| Set the number of points of a corner. More...
|
|
std::size_t | getPointCount () const override |
| Get the total number of points of the shape. More...
|
|
Vector2f | getPoint (std::size_t index) const override |
| Get a point of the shape. More...
|
|
| Shape () |
| Default constructor. More...
|
|
void | setTexture (const Texture &texture, bool resetRect) |
| Change the source texture of the shape. More...
|
|
void | setTexture (const Texture &texture, const RectF &textureRect=RectF::fromSize({ 1.0f, 1.0f })) |
| Change the source texture of the shape. More...
|
|
const Texture & | getTexture () const |
| Get the source texture of the shape. More...
|
|
bool | hasTexture () const |
| Check if a texture is set. More...
|
|
void | unsetTexture () |
| Unset the source texture of the shape. More...
|
|
void | setTextureRect (const RectF &rect) |
| Set the sub-rectangle of the texture that the shape will display. More...
|
|
const RectF & | getTextureRect () const |
| Get the sub-rectangle of the texture displayed by the shape. More...
|
|
void | setColor (const Color4f &color) |
| Set the fill color of the shape. More...
|
|
const Color4f & | getColor () const |
| Get the fill color of the shape. More...
|
|
void | setOutlineColor (const Color4f &color) |
| Set the outline color of the shape. More...
|
|
const Color4f & | getOutlineColor () const |
| Get the outline color of the shape. More...
|
|
void | setOutlineThickness (float thickness) |
| Set the thickness of the shape's outline. More...
|
|
float | getOutlineThickness () const |
| Get the outline thickness of the shape. More...
|
|
virtual std::size_t | getPointCount () const =0 |
| Get the total number of points of the shape. More...
|
|
virtual Vector2f | getPoint (std::size_t index) const =0 |
| Get a point of the shape. More...
|
|
RectF | getLocalBounds () const |
| Get the local bounding rectangle of the entity. More...
|
|
void | setAnchor (Anchor anchor) |
| Set the anchor origin of the entity. More...
|
|
VertexBuffer | commitGeometry () const |
| Create a buffer with the current geometry. More...
|
|
VertexBuffer | commitOutlineGeometry () const |
| Create a buffer with the current outline geometry. More...
|
|
virtual void | draw (RenderTarget &target, const RenderStates &states) override |
| Draw the object to a render target. More...
|
|
| Transformable () |
| Default constructor. More...
|
|
void | setOrigin (Vector2f origin) |
| Set the local origin of the object. More...
|
|
Vector2f | getOrigin () const |
| Get the local origin of the object. More...
|
|
void | setPosition (Vector2f position) |
| Set the position of the object. More...
|
|
Vector2f | getPosition () const |
| Get the position of the object. More...
|
|
void | move (Vector2f offset) |
| Move the object by a given offset. More...
|
|
void | setRotation (float angle) |
| Set the orientation of the object. More...
|
|
float | getRotation () const |
| Get the orientation of the object. More...
|
|
void | rotate (float angle) |
| Rotate the object. More...
|
|
void | setScale (Vector2f factors) |
| Set the scale factors of the object. More...
|
|
void | setScale (float factor) |
| Set the scale factor of the object. More...
|
|
Vector2f | getScale () const |
| Get the current scale of the object. More...
|
|
void | scale (Vector2f factors) |
| Scale the object. More...
|
|
void | scale (float factor) |
| Scale the object. More...
|
|
Matrix3f | getTransform () const |
| Get the combined transform of the object. More...
|
|
Matrix3f | getInverseTransform () const |
| Get the inverse of the combined transform of the object. More...
|
|
virtual | ~Drawable () |
| Virtual desctructor. More...
|
|
virtual void | draw (RenderTarget &target, const RenderStates &states)=0 |
| Draw the object to a render target. More...
|
|
Specialized shape representing a rounded rectangle.
This class inherits all the functions of gf::Transformable (position, rotation, scale, bounds, ...) as well as the functions of gf::Shape (outline, color, texture, ...).
Usage example:
rectangle.
setSize({ 100.0f, 50.0f });
...
window.draw(rect);
Specialized shape representing a rounded rectangle.
Definition: Shapes.h:396
void setRadius(float radius)
Set the radius of the corner.
void setSize(Vector2f size)
Set the size of the rectangle.
void setOutlineColor(const Color4f &color)
Set the outline color of the shape.
void setOutlineThickness(float thickness)
Set the thickness of the shape's outline.
static constexpr Color4< T > Red
Red predefined color.
Definition: Color.h:173
- See also
- gf::Shape