raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Protected Member Functions | List of all members
raylib::Camera2D Class Reference

Camera2D type, defines a 2d camera. More...

Public Member Functions

 Camera2D (::Vector2 offset, ::Vector2 target, float rotation=0.0f, float zoom=1.0f)
 
 Camera2D (const ::Camera2D &camera)
 
Camera2DBeginMode ()
 
Camera2DEndMode ()
 
Matrix GetMatrix () const
 Returns camera 2d transform matrix.
 
::Vector2 GetOffset () const
 Retrieves the offset value for the object. More...
 
float GetRotation () const
 Retrieves the rotation value for the object. More...
 
Vector2 GetScreenToWorld (::Vector2 position) const
 Returns the world space position for a 2d camera screen space position.
 
::Vector2 GetTarget () const
 Retrieves the target value for the object. More...
 
Vector2 GetWorldToScreen (::Vector2 position) const
 Returns the screen space position for a 2d world space position.
 
float GetZoom () const
 Retrieves the zoom value for the object. More...
 
Camera2Doperator= (const ::Camera2D &camera)
 
void SetOffset (::Vector2 value)
 Sets the offset value for the object. More...
 
void SetRotation (float value)
 Sets the rotation value for the object. More...
 
void SetTarget (::Vector2 value)
 Sets the target value for the object. More...
 
void SetZoom (float value)
 Sets the zoom value for the object. More...
 

Protected Member Functions

void set (const ::Camera2D &camera)
 

Detailed Description

Camera2D type, defines a 2d camera.

Definition at line 12 of file Camera2D.hpp.

Member Function Documentation

◆ GetOffset()

::Vector2 raylib::Camera2D::GetOffset ( ) const
inline

Retrieves the offset value for the object.

Returns
The offset value of the object.

Definition at line 30 of file Camera2D.hpp.

◆ GetRotation()

float raylib::Camera2D::GetRotation ( ) const
inline

Retrieves the rotation value for the object.

Returns
The rotation value of the object.

Definition at line 32 of file Camera2D.hpp.

◆ GetTarget()

::Vector2 raylib::Camera2D::GetTarget ( ) const
inline

Retrieves the target value for the object.

Returns
The target value of the object.

Definition at line 31 of file Camera2D.hpp.

◆ GetZoom()

float raylib::Camera2D::GetZoom ( ) const
inline

Retrieves the zoom value for the object.

Returns
The zoom value of the object.

Definition at line 33 of file Camera2D.hpp.

◆ SetOffset()

void raylib::Camera2D::SetOffset ( ::Vector2  value)
inline

Sets the offset value for the object.

Parameters
valueThe value of which to set offset to.

Definition at line 30 of file Camera2D.hpp.

◆ SetRotation()

void raylib::Camera2D::SetRotation ( float  value)
inline

Sets the rotation value for the object.

Parameters
valueThe value of which to set rotation to.

Definition at line 32 of file Camera2D.hpp.

◆ SetTarget()

void raylib::Camera2D::SetTarget ( ::Vector2  value)
inline

Sets the target value for the object.

Parameters
valueThe value of which to set target to.

Definition at line 31 of file Camera2D.hpp.

◆ SetZoom()

void raylib::Camera2D::SetZoom ( float  value)
inline

Sets the zoom value for the object.

Parameters
valueThe value of which to set zoom to.

Definition at line 33 of file Camera2D.hpp.