33 #ifndef DOXYGEN_SHOULD_SKIP_THIS 108 explicit View(
const RectF& rect);
116 View(Vector2f center, Vector2f size);
154 onSizeChange(m_size);
178 m_rotation = rotation;
234 void reset(
const RectF& rect);
243 void move(Vector2f offset);
268 void zoom(
float factor);
288 void zoom(
float factor, Vector2f fixed);
459 gf::Vector2i m_mousePosition;
469 #ifndef DOXYGEN_SHOULD_SKIP_THIS View(Vector2f center, Vector2f size)
Construct the view from its center and size.
2D camera that defines what region is shown on screen
Definition: View.h:94
A view adaptor for zooming/moving with the mouse.
Definition: View.h:439
AdaptativeView(const RectF &rect)
Construct the view from a rectangle.
Definition: View.h:401
float getRotation() const
Get the current orientation of the view.
Definition: View.h:188
Matrix3f getTransform() const
Get the projection transform of the view.
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:66
View()
Default constructor.
void setViewportNoCallback(const RectF &viewport)
Set the viewport, without calling onViewportChange()
void processEvent(const Event &event)
Update the original view thanks to the event.
virtual void onScreenSizeChange(Vector2u screenSize)=0
Callback when the screen has just been resized.
virtual void onSizeChange(Vector2f size)
Callback when the world has just been resized.
ZoomingViewAdaptor(const RenderTarget &target, View &view)
Constructor.
void zoom(float factor)
Resize the view rectangle relatively to its current size.
void setViewport(const RectF &viewport)
Set the target viewport.
const RectF & getViewport() const
Get the target viewport rectangle of the view.
Definition: View.h:221
void rotate(float angle)
Rotate the view relatively to its current orientation.
The namespace for gf classes.
Definition: Action.h:34
virtual void onViewportChange(const RectF &viewport)
Callback when the viewport has just been changed.
void setSizeNoCallback(Vector2f size)
Set the world size, without calling onSizeChange()
Definition: View.h:321
Vector2f getCenter() const
Get the center of the view.
Definition: View.h:141
void move(Vector2f offset)
Move the view relatively to its current position.
void setSize(Vector2f size)
Set the size of the view.
Definition: View.h:152
Matrix3f getInverseTransform() const
Get the inverse projection transform of the view.
View(const RectF &rect)
Construct the view from a rectangle.
AdaptativeView()
Default constructor.
Definition: View.h:390
Vector2f getSize() const
Get the size of the view.
Definition: View.h:164
Defines a system event and its parameters.
Definition: Event.h:118
void zoom(float factor, Vector2f fixed)
Resize the view rectangle relatively to its current size and a fixed point.
#define GF_API
Definition: Portability.h:35
Adaptative view.
Definition: View.h:383
void setRotation(float rotation)
Set the orientation of the view.
Definition: View.h:177
virtual ~View()
Destructor.
AdaptativeView(Vector2f center, Vector2f size)
Construct the view from its center and size.
Definition: View.h:413
void setInitialScreenSize(Vector2u screenSize)
Set the initial screen size.
void reset(const RectF &rect)
Reset the view to the given rectangle.
void setCenter(Vector2f center)
Set the center of the view.
Definition: View.h:130