Platformer
Platformer
Public Member Functions | Private Attributes | List of all members
CameraComponent Class Reference

A class representing a camera within our game. More...

#include <CameraComponent.hpp>

Inheritance diagram for CameraComponent:
Inheritance graph
Collaboration diagram for CameraComponent:
Collaboration graph

Public Member Functions

 CameraComponent ()
 Constructs a new CameraComponent that renders the whole screen. More...
 
 CameraComponent (SDL_Rect renderView)
 Constructs a new CameraComponent that renders to the whole screen. More...
 
 CameraComponent (SDL_Rect renderView, SDL_Rect renderArea)
 Constructs a new CameraComponent. More...
 
void Update () override
 Updates this component.
 
void Translate (SDL_Rect &dest)
 Translates the given SDL_Rect based on this camera.
 
void SetActive ()
 Set this camera as the active camera.
 
void SetCaptureArea (SDL_Rect r)
 Sets the area viewed by the camera to the given rect.
 
- Public Member Functions inherited from Component
void SetParentGameObject (std::weak_ptr< GameObject > g)
 Sets the given GameObject as this component's parent. More...
 
virtual void Init ()
 Initializes this component.
 
std::shared_ptr< GameObjectGetGameObject ()
 Gets a shared ptr reference to this component's GameObject. More...
 

Private Attributes

SDL_Rect renderView
 The area of the game world to capture.
 
SDL_Rect renderArea
 The render area for this camera.
 

Additional Inherited Members

- Protected Attributes inherited from Component
std::weak_ptr< GameObjectgameObject
 This component's parent GameObject.
 

Detailed Description

A class representing a camera within our game.

Constructor & Destructor Documentation

◆ CameraComponent() [1/3]

CameraComponent::CameraComponent ( )

Constructs a new CameraComponent that renders the whole screen.

Here is the call graph for this function:

◆ CameraComponent() [2/3]

CameraComponent::CameraComponent ( SDL_Rect  renderView)

Constructs a new CameraComponent that renders to the whole screen.

Parameters
renderViewThe area of the game world to capture, defined by its center
Here is the call graph for this function:

◆ CameraComponent() [3/3]

CameraComponent::CameraComponent ( SDL_Rect  renderView,
SDL_Rect  renderArea 
)

Constructs a new CameraComponent.

Parameters
renderViewThe area of the game world to capture, defined by its center
renderAreaThe render area on the screen for this camera

The documentation for this class was generated from the following files: