dEngine
Simple 2D C++ game engine
|
A camera. More...
#include <Camera.h>
Public Member Functions | |
Camera (std::string name, int x, int y, int height, int width) | |
Constructor. More... | |
Camera (std::string name, int height, int width) | |
Constructor. More... | |
std::string | GetName () |
Get Camera Name. More... | |
void | SetPosition (int x, int y) |
Set camera position. More... | |
Private Attributes | |
SDL_Rect | pos |
std::string | name |
A camera.
The camera is meant to be used as a view point for the player or user of the application. This allows the scene to focus on different aspects of the environment or different viewpoints of the character.
Camera::Camera | ( | std::string | name, |
int | x, | ||
int | y, | ||
int | height, | ||
int | width | ||
) |
Constructor.
Create a new camera with x,y coordinates
name | The name of the camera |
x | The X coordinate of the camera |
y | The Y coordinate of the camera |
height | The height of the viewport |
width | The width of the viewport |
Camera::Camera | ( | std::string | name, |
int | height, | ||
int | width | ||
) |
Constructor.
Create a new camera with default x and y coordinates
name | The name of the camera |
height | The height of the viewport |
width | The width of the viewport |
void Camera::SetPosition | ( | int | x, |
int | y | ||
) |
Set camera position.
x | X coordinate |
y | Y coordinate |
|
private |
Referenced by Camera(), and SetPosition().