27#include "GraphicsApi.h"
28#include "Transformable.h"
29#include "VertexArray.h"
30#include "VertexBuffer.h"
33#ifndef DOXYGEN_SHOULD_SKIP_THIS
98 [[deprecated(
"You should use setTexture(const Texture&, const RectF&) instead")]]
141 return m_texture !=
nullptr;
175 return m_textureRect;
226 return m_outlineColor;
247 return m_outlineThickness;
347 void updateTexCoords();
348 void updateOutline();
349 void updateOutlineColors();
359 float m_outlineThickness;
363#ifndef DOXYGEN_SHOULD_SKIP_THIS
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:102
Base class for textured shapes with outline.
Definition: Shape.h:73
VertexBuffer commitGeometry() const
Create a buffer with the current geometry.
void updateGeometry()
Recompute the internal geometry of the shape.
virtual std::size_t getPointCount() const =0
Get the total number of points of the shape.
void updateAutoBounds()
Compute the bounds of the shape automatically.
void setTexture(const Texture &texture, bool resetRect)
Change the source texture of the shape.
void unsetTexture()
Unset the source texture of the shape.
void setOutlineColor(const Color4f &color)
Set the outline color of the shape.
bool hasTexture() const
Check if a texture is set.
Definition: Shape.h:140
RectF getLocalBounds() const
Get the local bounding rectangle of the entity.
virtual void draw(RenderTarget &target, const RenderStates &states) override
Draw the object to a render target.
float getOutlineThickness() const
Get the outline thickness of the shape.
Definition: Shape.h:246
Shape()
Default constructor.
void updateBounds(RectF bounds)
Set the bounds of the shape directly.
const Color4f & getOutlineColor() const
Get the outline color of the shape.
Definition: Shape.h:225
virtual Vector2f getPoint(std::size_t index) const =0
Get a point of the shape.
void setOutlineThickness(float thickness)
Set the thickness of the shape's outline.
VertexBuffer commitOutlineGeometry() const
Create a buffer with the current outline geometry.
void setAnchor(Anchor anchor)
Set the anchor origin of the entity.
void setColor(const Color4f &color)
Set the fill color of the shape.
void setTexture(const Texture &texture, const RectF &textureRect=RectF::fromSize({ 1.0f, 1.0f }))
Change the source texture of the shape.
const Color4f & getColor() const
Get the fill color of the shape.
Definition: Shape.h:203
const RectF & getTextureRect() const
Get the sub-rectangle of the texture displayed by the shape.
Definition: Shape.h:174
const Texture & getTexture() const
Get the source texture of the shape.
Definition: Shape.h:129
void setTextureRect(const RectF &rect)
Set the sub-rectangle of the texture that the shape will display.
A texture for colored images.
Definition: Texture.h:313
A set of primitives.
Definition: VertexArray.h:65
Data in the graphics memory.
Definition: VertexBuffer.h:81
Anchor
An anchor of a box.
Definition: Anchor.h:38
The namespace for gf classes.
static constexpr Rect< float > fromSize(Vector< float, 2 > size) noexcept
Create a rectangle from a size.
Definition: Rect.h:114
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
A 4D vector.
Definition: Vector.h:852