-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewport.h
38 lines (34 loc) · 918 Bytes
/
viewport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef VIEWPORT__H
#define VIEWPORT__H
#include "drawable.h"
#include "gameData.h"
class Viewport {
public:
static Viewport& getInstance();
void draw() const;
void update();
Vector2f getPosition() const { return viewPos; }
float getX() const { return viewPos[0]; }
void setX(float x) { viewPos[0] = x; }
float getY() const { return viewPos[1]; }
void setY(float y) { viewPos[1] = y; }
int getWidth() const {return viewWidth;}
int getHeight() const {return viewHeight;}
void setObjectToTrack(const Drawable *obj);
const Drawable* getObjectToTrack() const { return objectToTrack; }
private:
const Gamedata& gdata;
Vector2f viewPos;
Vector2f msgPos;
int worldWidth;
int worldHeight;
int viewWidth;
int viewHeight;
int objWidth;
int objHeight;
const Drawable *objectToTrack;
Viewport();
Viewport(const Viewport&);
Viewport& operator=(const Viewport&);
};
#endif