26#ifndef TGUI_SPRITE_HPP
27#define TGUI_SPRITE_HPP
29#include <TGUI/Texture.hpp>
30#include <TGUI/Vector2f.hpp>
31#include <TGUI/FloatRect.hpp>
32#include <TGUI/Color.hpp>
33#include <TGUI/Aurora/SmartPtr/CopiedPtr.hpp>
34#include <SFML/Graphics/Transformable.hpp>
35#include <SFML/Graphics/RenderStates.hpp>
36#include <SFML/Graphics/Vertex.hpp>
45 class TGUI_API
Sprite :
public sf::Transformable
133#ifndef TGUI_REMOVE_DEPRECATED_CODE
145 TGUI_DEPRECATED(
"Color should be changed through the texture") void setColor(const
Color& color);
159 TGUI_DEPRECATED("
Color should be changed through the texture") const
Color& getColor() const;
225 void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
234 void updateVertices();
242 aurora::CopiedPtr<sf::Texture> m_svgTexture;
243 std::vector<sf::Vertex> m_vertices;
247 sf::Shader* m_shader =
nullptr;
Wrapper for colors.
Definition: Color.hpp:49
static const Color White
White predefined color.
Definition: Color.hpp:207
Definition: FloatRect.hpp:37
Definition: Sprite.hpp:46
FloatRect getVisibleRect() const
Returns the part of the sprite that is drawn.
ScalingType
The way the image should be scaled.
Definition: Sprite.hpp:54
float getOpacity() const
Returns the opacity of the texture.
Sprite()=default
Default constructor.
ScalingType getScalingType() const
Returns the way in which the image is being scaled.
bool isSet() const
Returns whether a texture was set.
void setSize(const Vector2f &size)
Changes the size that the image will have when drawing.
const Texture & getTexture() const
Returns the texture used by this sprite.
Sprite(const Texture &texture)
Constructor that immediately sets the texture.
void setTexture(const Texture &texture)
Changes the texture.
Texture & getTexture()
Returns a reference to the texture used by this sprite.
void setVisibleRect(const FloatRect &visibleRect)
Changes the part of the sprite that should be drawn.
void draw(sf::RenderTarget &target, sf::RenderStates states) const
Draws the sprite.
Vector2f getSize() const
Returns the size that the image has when drawing.
bool isTransparentPixel(Vector2f pos) const
Checks if a certain pixel is transparent.
virtual void setOpacity(float opacity)
Changes the opacity of the texture.
Definition: Texture.hpp:42
Definition: Vector2f.hpp:39
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37