Dualie
Loading...
Searching...
No Matches
View.hpp
1//
2// Created by caleb on 6/18/24.
3//
4
5#ifndef DUALIE_VIEW_H
6#define DUALIE_VIEW_H
7
8
9#include <Dualie/System/Rect.hpp>
10#include <Dualie/System/Vector2.hpp>
11
12namespace dl{
13
19 class View {
20
21 private:
22 dl::FloatRect m_viewRect;
23
24
25 public:
26
27
28 View();
29 View(const dl::FloatRect& viewRect);
30
35 void reset(const dl::FloatRect& viewRect);
36
41 void setCenter(dl::Vector2f center);
42
47 void move(dl::Vector2f offset);
48
54
55
56 };
57
58}
59
60
61#endif //DUALIE_VIEW_H
Used as a camera-like object to move the screen view to different positions in world coordinates.
Definition View.hpp:19
dl::Vector2f getOffset()
Definition View.cpp:27
void move(dl::Vector2f offset)
Moves the view offset number of pixels.
Definition View.cpp:22
void reset(const dl::FloatRect &viewRect)
Sets the view's viewrect to a new viewrect.
Definition View.cpp:13
void setCenter(dl::Vector2f center)
Sets the center of the view's rect.
Definition View.cpp:17