33 #ifndef DOXYGEN_SHOULD_SKIP_THIS 157 return m_texture !=
nullptr;
194 return m_textureRect;
210 void setColor(
const Color4f& color);
260 void updatePositions();
261 void updateTexCoords();
270 #ifndef DOXYGEN_SHOULD_SKIP_THIS
Sprite()
Default constructor.
Sprite(const Texture &texture)
Construct the sprite from a source texture.
void setAnchor(Anchor anchor)
Set the anchor origin of the entity.
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:66
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
A point associated with a color and a texture coordinate.
Definition: Vertex.h:75
VertexBuffer commitGeometry() const
Create a buffer with the current geometry.
A drawable representation of a texture, with its own transformations, color, etc. ...
Definition: Sprite.h:87
Data in the graphics memory.
Definition: VertexBuffer.h:70
void setColor(const Color4f &color)
Set the global color of the sprite.
Sprite(const Texture &texture, const RectF &textureRect)
Construct the sprite from a sub-rectangle of a source texture.
A texture for colored images.
Definition: Texture.h:339
virtual void draw(RenderTarget &target, RenderStates states) override
Draw the object to a render target.
RectF getLocalBounds() const
Get the local bounding rectangle of the entity.
The namespace for gf classes.
Definition: Action.h:34
const Color4f & getColor() const
Get the global color of the sprite.
void setTexture(const Texture &texture, bool resetRect=false)
Change the source texture of the sprite.
Anchor
An anchor of a box.
Definition: Anchor.h:41
bool hasTexture() const
Check if a texture is set.
Definition: Sprite.h:156
void unsetTexture()
Unset the source texture of the sprite.
void setTextureRect(const RectF &rect)
Set the sub-rectangle of the texture that the sprite will display.
#define GF_API
Definition: Portability.h:35
const RectF & getTextureRect() const
Get the sub-rectangle of the texture displayed by the sprite.
Definition: Sprite.h:193
const Texture & getTexture() const
Get the source texture of the sprite.
Definition: Sprite.h:145