25#ifndef SFML_SPRITE_HPP
26#define SFML_SPRITE_HPP
31#include <SFML/System/Resource.hpp>
32#include <SFML/Graphics/Drawable.hpp>
33#include <SFML/Graphics/Rect.hpp>
64 explicit Sprite(
const Image& Img,
const Vector2f& Position = Vector2f(0, 0),
const Vector2f&
Scale = Vector2f(1, 1),
float Rotation = 0.f,
const Color& Col =
Color(255, 255, 255, 255));
91 void Resize(
float Width,
float Height);
100 void Resize(
const Vector2f& Size);
108 void FlipX(
bool Flipped);
116 void FlipY(
bool Flipped);
160 virtual void Render(RenderTarget& Target)
const;
Color is an utility class for manipulating 32-bits RGBA colors.
void Scale(float FactorX, float FactorY)
Scale the object (take 2 values).
Drawable(const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255))
Default constructor.
Image is the low-level class for loading and manipulating images.
Safe pointer to a T resource (inheriting from sf::Resource<T>), its pointer is automatically reseted ...
Color GetPixel(unsigned int X, unsigned int Y) const
Get the color of a given pixel in the sprite (point is in local coordinates).
void FlipX(bool Flipped)
Flip the sprite horizontally.
void SetImage(const Image &Img)
Change the image of the sprite.
void Resize(float Width, float Height)
Resize the sprite (by changing its scale factors) (take 2 values).
void SetSubRect(const IntRect &SubRect)
Set the sub-rectangle of the sprite inside the source image.
const Image * GetImage() const
Get the source image of the sprite.
virtual void Render(RenderTarget &Target) const
/see Drawable::Render
const IntRect & GetSubRect() const
Get the sub-rectangle of the sprite inside the source image.
void FlipY(bool Flipped)
Flip the sprite vertically.
Sprite()
Default constructor.
Vector2f GetSize() const
Get the sprite size.