25#ifndef SFML_DRAWABLE_HPP
26#define SFML_DRAWABLE_HPP
31#include <SFML/System/Vector2.hpp>
32#include <SFML/Graphics/Color.hpp>
33#include <SFML/Graphics/Matrix3.hpp>
71 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));
119 void SetScale(
float ScaleX,
float ScaleY);
154 void SetCenter(
float CenterX,
float CenterY);
248 void Move(
float OffsetX,
float OffsetY);
256 void Move(
const Vector2f& Offset);
265 void Scale(
float FactorX,
float FactorY);
273 void Scale(
const Vector2f& Factor);
325 friend class RenderTarget;
333 void Draw(RenderTarget& Target)
const;
341 virtual void Render(RenderTarget& Target)
const = 0;
352 mutable bool myNeedUpdate;
353 mutable bool myInvNeedUpdate;
Color is an utility class for manipulating 32-bits RGBA colors.
void SetScale(float ScaleX, float ScaleY)
Set the scale of the object (take 2 values).
void SetScaleX(float FactorX)
Set the X scale factor of the object.
void SetCenter(float CenterX, float CenterY)
Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).
const Matrix3 & GetMatrix() const
Get the transform matrix of the drawable.
void Scale(float FactorX, float FactorY)
Scale the object (take 2 values).
const Vector2f & GetPosition() const
Get the position of the object.
const Vector2f & GetScale() const
Get the current scale of the object.
void Rotate(float Angle)
Rotate the object.
void SetPosition(float X, float Y)
Set the position of the object (take 2 values).
const Matrix3 & GetInverseMatrix() const
Get the inverse transform matrix of the drawable.
void Move(float OffsetX, float OffsetY)
Move the object of a given offset (take 2 values).
void SetRotation(float Rotation)
Set the orientation of the object.
sf::Vector2f TransformToGlobal(const sf::Vector2f &Point) const
Transform a point from local coordinates into global coordinates (ie it applies the object's center,...
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.
Blend::Mode GetBlendMode() const
Get the current blending mode.
const Color & GetColor() const
Get the color of the object.
void SetY(float Y)
Set the Y position of the object.
void SetScaleY(float FactorY)
Set the Y scale factor of the object.
void SetColor(const Color &Col)
Set the color of the object.
void SetBlendMode(Blend::Mode Mode)
Set the blending mode for the object.
const Vector2f & GetCenter() const
Get the center of the object.
void SetX(float X)
Set the X position of the object.
sf::Vector2f TransformToLocal(const sf::Vector2f &Point) const
Transform a point from global coordinates into local coordinates (ie it applies the inverse of object...
float GetRotation() const
Get the orientation of the object.
Utility class to manipulate 3x3 matrices representing 2D transformations.
Base class for all render targets (window, image, ...).
Enumerate the blending modes for drawable objects.
@ Alpha
Pixel = Src * a + Dest * (1 - a).
@ Multiply
Pixel = Src * Dest.