This class is to represent a camera.
More...
#include <Camera.h>
This class is to represent a camera.
- Contains camera's position
- Can scale the view
- Can Move
- Can follow a given WorldObject
Definition at line 13 of file Camera.h.
Follows the given world object with padding amount of leeway.
- Parameters
-
| o | The WorldObject to follow |
| padding | The amount of padding in the x and y that the sprite can move without moving the camera |
Definition at line 4 of file Camera.cpp.
Moves camera to given position.
- Parameters
-
| p | Position to move the camera |
Definition at line 13 of file Camera.cpp.
| void Camera::stopFollow |
( |
| ) |
|
Stops following of world object.
Definition at line 9 of file Camera.cpp.
| void Camera::updatePos |
( |
| ) |
|
Updates the camera's position if following.
- Todo:
- implement edge stopping. I.E. if screen hits the edge of the map stop following the sprite in that direction.
Definition at line 17 of file Camera.cpp.
| void Camera::zoom |
( |
double |
zoom | ) |
|
Set the current zoom amount.
- Parameters
-
| zoom | Amount to zoom where 1 == 100% |
Definition at line 30 of file Camera.cpp.
| void Camera::zoomIn |
( |
double |
zoom | ) |
|
Allows the camera to zoom in a given amount.
- Parameters
-
| zoom | Amount to zoom in relative to currentZoom where 1 == 100% |
Definition at line 45 of file Camera.cpp.
| void Camera::zoomOut |
( |
double |
zoom | ) |
|
Allows the camera to zoom out a given amount.
- Parameters
-
| zoom | Amount to zoom where 1 == 100% |
Definition at line 49 of file Camera.cpp.
Object to follow.
Definition at line 64 of file Camera.h.
Padding amount before box starts moving.
Definition at line 66 of file Camera.h.
Amount of zoom.
Definition at line 68 of file Camera.h.
The documentation for this class was generated from the following files: