Dualie
Loading...
Searching...
No Matches
dl::View Class Reference

Used as a camera-like object to move the screen view to different positions in world coordinates. More...

#include <View.hpp>

Public Member Functions

 View (const dl::FloatRect &viewRect)
 
void reset (const dl::FloatRect &viewRect)
 Sets the view's viewrect to a new viewrect.
 
void setCenter (dl::Vector2f center)
 Sets the center of the view's rect.
 
void move (dl::Vector2f offset)
 Moves the view offset number of pixels.
 
dl::Vector2f getOffset ()
 

Detailed Description

Used as a camera-like object to move the screen view to different positions in world coordinates.

Note
This class is used to calculate the view offset, which is used in draw functions to offset object positions. The default view offset is (0,0)

Member Function Documentation

◆ getOffset()

dl::Vector2f dl::View::getOffset ( )
Returns
The view's render offset

◆ move()

void dl::View::move ( dl::Vector2f offset)

Moves the view offset number of pixels.

Parameters
offsetThe offset to move

◆ reset()

void dl::View::reset ( const dl::FloatRect & viewRect)

Sets the view's viewrect to a new viewrect.

Parameters
viewRectThe viewrect to reset to

◆ setCenter()

void dl::View::setCenter ( dl::Vector2f center)

Sets the center of the view's rect.

Parameters
centerThe center to set

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