EchoesOfFate
A game for our COMP315 Project
 
Loading...
Searching...
No Matches
Camera.h
Go to the documentation of this file.
1#ifndef CAMERA_H
2#define CAMERA_H
3
4#include <memory>
5#include "Map.h"
6
7using namespace sf;
8
9class Camera
10{
11 private:
12 float cameraXRelativeToMap;
13 float cameraYRelativeToMap;
14 static constexpr float zoomFactor = 1.1f;
15 static constexpr float unzoomFactor = 0.9f;
16 View cameraView;
17 std::shared_ptr<Map> map;
18 public:
19 static constexpr float cameraSpeed = 400.0f;
20
21 Camera(const RenderWindow& window, std::shared_ptr<Map> mapRef);
22
23 void updateCameraView(float deltaX, float deltaY, char direction);
24 View getCameraView() const;
25 void setPosition(float x, float y);
26 float getCameraXRelativeToMap() const;
27 float getCameraYRelativeToMap() const;
28 void resizeCamera(const RenderWindow& window);
29 void cameraKeyHandle(Event event);
30};
31
32#endif
void cameraKeyHandle(Event event)
Will implement later.
Definition Camera.cpp:72
View getCameraView() const
Definition Camera.cpp:94
static constexpr float cameraSpeed
Definition Camera.h:19
void setPosition(float x, float y)
Definition Camera.cpp:89
float getCameraYRelativeToMap() const
Definition Camera.cpp:117
Camera(const RenderWindow &window, std::shared_ptr< Map > mapRef)
Speed may become dynamic later.
Definition Camera.cpp:4
float getCameraXRelativeToMap() const
Definition Camera.cpp:112
void updateCameraView(float deltaX, float deltaY, char direction)
Definition Camera.cpp:15
void resizeCamera(const RenderWindow &window)
Definition Camera.cpp:99