|
SFML
Simple and Fast Multimedia Library
|
Specialized shape representing a rectangle. More...
#include <RectangleShape.hpp>
Public Member Functions | |
| RectangleShape (Vector2f size={}) | |
| Default constructor. | |
| void | setSize (Vector2f size) |
| Set the size of the rectangle. | |
| Vector2f | getSize () const |
| Get the size of the rectangle. | |
| std::size_t | getPointCount () const override |
| Get the number of points defining the shape. | |
| Vector2f | getPoint (std::size_t index) const override |
| Get a point of the rectangle. | |
| Vector2f | getGeometricCenter () const override |
| Get the geometric center of the rectangle. | |
| Public Member Functions inherited from sf::Shape | |
| void | setTexture (const Texture *texture, bool resetRect=false) |
| Change the source texture of the shape. | |
| void | setTextureRect (const IntRect &rect) |
| Set the sub-rectangle of the texture that the shape will display. | |
| void | setFillColor (Color color) |
| Set the fill color of the shape. | |
| void | setOutlineColor (Color color) |
| Set the outline color of the shape. | |
| void | setOutlineThickness (float thickness) |
| Set the thickness of the shape's outline. | |
| const Texture * | getTexture () const |
| Get the source texture of the shape. | |
| const IntRect & | getTextureRect () const |
| Get the sub-rectangle of the texture displayed by the shape. | |
| Color | getFillColor () const |
| Get the fill color of the shape. | |
| Color | getOutlineColor () const |
| Get the outline color of the shape. | |
| float | getOutlineThickness () const |
| Get the outline thickness of the shape. | |
| FloatRect | getLocalBounds () const |
| Get the local bounding rectangle of the entity. | |
| FloatRect | getGlobalBounds () const |
| Get the global (non-minimal) bounding rectangle of the entity. | |
| Public Member Functions inherited from sf::Drawable | |
| virtual | ~Drawable ()=default |
| Virtual destructor. | |
| Public Member Functions inherited from sf::Transformable | |
| Transformable ()=default | |
| Default constructor. | |
| virtual | ~Transformable ()=default |
| Virtual destructor. | |
| void | setPosition (Vector2f position) |
| set the position of the object | |
| void | setRotation (Angle angle) |
| set the orientation of the object | |
| void | setScale (Vector2f factors) |
| set the scale factors of the object | |
| void | setOrigin (Vector2f origin) |
| set the local origin of the object | |
| Vector2f | getPosition () const |
| get the position of the object | |
| Angle | getRotation () const |
| get the orientation of the object | |
| Vector2f | getScale () const |
| get the current scale of the object | |
| Vector2f | getOrigin () const |
| get the local origin of the object | |
| void | move (Vector2f offset) |
| Move the object by a given offset. | |
| void | rotate (Angle angle) |
| Rotate the object. | |
| void | scale (Vector2f factor) |
| Scale the object. | |
| const Transform & | getTransform () const |
| get the combined transform of the object | |
| const Transform & | getInverseTransform () const |
| get the inverse of the combined transform of the object | |
Additional Inherited Members | |
| Protected Member Functions inherited from sf::Shape | |
| void | update () |
| Recompute the internal geometry of the shape. | |
Specialized shape representing a rectangle.
This class inherits all the functions of sf::Transformable (position, rotation, scale, bounds, ...) as well as the functions of sf::Shape (outline, color, texture, ...).
Usage example:
|
explicit |
Default constructor.
| size | Size of the rectangle |
|
nodiscardoverridevirtual |
Get the geometric center of the rectangle.
The returned point is in local coordinates, that is, the shape's transforms (position, rotation, scale) are not taken into account.
Reimplemented from sf::Shape.
|
nodiscardoverridevirtual |
Get a point of the rectangle.
The returned point is in local coordinates, that is, the shape's transforms (position, rotation, scale) are not taken into account. The result is undefined if index is out of the valid range.
| index | Index of the point to get, in range [0 .. 3] |
Implements sf::Shape.
|
nodiscardoverridevirtual |
Get the number of points defining the shape.
Implements sf::Shape.
|
nodiscard |
| void sf::RectangleShape::setSize | ( | Vector2f | size | ) |