27#include "BasicSprite.h"
28#include "GraphicsApi.h"
29#include "Transformable.h"
31#include "VertexBuffer.h"
34#ifndef DOXYGEN_SHOULD_SKIP_THIS
121 [[deprecated(
"You should use setTexture(const Texture&, const RectF&) instead")]]
153 return m_basic.getTexture();
164 return m_basic.hasTexture();
201 return m_basic.getTextureRect();
271#ifndef DOXYGEN_SHOULD_SKIP_THIS
A basic sprite.
Definition: BasicSprite.h:46
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:102
A drawable representation of a texture, with its own transformations, color, etc.
Definition: Sprite.h:75
void setTexture(const Texture &texture, const RectF &textureRect=RectF::fromSize({ 1.0f, 1.0f }))
Change the source texture of the sprite.
const Texture & getTexture() const
Get the source texture of the sprite.
Definition: Sprite.h:152
void setTexture(const Texture &texture, bool resetRect)
Change the source texture of the sprite.
Sprite(const Texture &texture)
Construct the sprite from a source texture.
Sprite(const Texture &texture, const RectF &textureRect)
Construct the sprite from a sub-rectangle of a source texture.
void setAnchor(Anchor anchor)
Set the anchor origin of the entity.
void unsetTexture()
Unset the source texture of the sprite.
const Color4f & getColor() const
Get the global color of the sprite.
virtual void draw(RenderTarget &target, const RenderStates &states) override
Draw the object to a render target.
VertexBuffer commitGeometry() const
Create a buffer with the current geometry.
void setColor(const Color4f &color)
Set the global color of the sprite.
RectF getLocalBounds() const
Get the local bounding rectangle of the entity.
void setTextureRect(const RectF &rect)
Set the sub-rectangle of the texture that the sprite will display.
const RectF & getTextureRect() const
Get the sub-rectangle of the texture displayed by the sprite.
Definition: Sprite.h:200
Sprite()
Default constructor.
bool hasTexture() const
Check if a texture is set.
Definition: Sprite.h:163
A texture for colored images.
Definition: Texture.h:313
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
A point associated with a color and a texture coordinate.
Definition: Vertex.h:75