31#include <SFML/Config.hpp>
32#include <SFML/Graphics/Rect.hpp>
33#include <SFML/Graphics/Matrix3.hpp>
34#include <SFML/System/Vector2.hpp>
55 explicit View(
const FloatRect& ViewRect = FloatRect(0, 0, 1000, 1000));
64 View(
const sf::Vector2f& Center,
const sf::Vector2f& HalfSize);
81 void SetCenter(
const sf::Vector2f& Center);
90 void SetHalfSize(
float HalfWidth,
float HalfHeight);
130 const sf::FloatRect&
GetRect()
const;
139 void Move(
float OffsetX,
float OffsetY);
147 void Move(
const sf::Vector2f& Offset);
155 void Zoom(
float Factor);
159 friend class RenderTarget;
167 const Matrix3& GetMatrix()
const;
173 void RecomputeMatrix();
178 sf::Vector2f myCenter;
179 sf::Vector2f myHalfSize;
Utility class to manipulate 3x3 matrices representing 2D transformations.
Base class for all render targets (window, image, ...).
void Zoom(float Factor)
Resize the view rectangle to simulate a zoom / unzoom effect.
const sf::Vector2f & GetHalfSize() const
Get the half-size of the view.
void SetHalfSize(float HalfWidth, float HalfHeight)
Change the half-size of the view (take 2 values).
View(const FloatRect &ViewRect=FloatRect(0, 0, 1000, 1000))
Construct the view from a rectangle.
void Move(float OffsetX, float OffsetY)
Move the view (take 2 values).
const sf::FloatRect & GetRect() const
Get the bounding rectangle of the view.
void SetFromRect(const FloatRect &ViewRect)
Rebuild the view from a rectangle.
const sf::Vector2f & GetCenter() const
Get the center of the view.
void SetCenter(float X, float Y)
Change the center of the view (take 2 values).