This class defines a view (position, size, etc.) ; you can consider it as a 2D camera.
More...
#include <View.hpp>
This class defines a view (position, size, etc.) ; you can consider it as a 2D camera.
Definition at line 45 of file View.hpp.
Construct the view from a rectangle.
- Parameters
-
ViewRect | : Rectangle defining the position and size of the view (1000x1000 by default) |
Construct the view from its center and half-size.
- Parameters
-
Center | : Center of the view |
HalfSize | : Half-size of the view (from center to corner) |
Get the center of the view.
- Returns
- Center of the view
Get the half-size of the view.
- Returns
- Half-size of the view
Get the bounding rectangle of the view.
- Returns
- Bounding rectangle of the view
void sf::View::Move |
( |
float |
OffsetX, |
|
|
float |
OffsetY |
|
) |
| |
Move the view (take 2 values)
- Parameters
-
OffsetX | : Offset to move the view, on X axis |
OffsetY | : Offset to move the view, on Y axis |
Move the view (take a vector)
- Parameters
-
Offset | : Offset to move the view |
void sf::View::SetCenter |
( |
float |
X, |
|
|
float |
Y |
|
) |
| |
Change the center of the view (take 2 values)
- Parameters
-
X | : X coordinate of the new center |
Y | : Y coordinate of the new center |
Change the center of the view (take a vector)
- Parameters
-
void sf::View::SetFromRect |
( |
const FloatRect & |
ViewRect | ) |
|
Rebuild the view from a rectangle.
- Parameters
-
ViewRect | : Rectangle defining the position and size of the view |
void sf::View::SetHalfSize |
( |
float |
HalfWidth, |
|
|
float |
HalfHeight |
|
) |
| |
Change the half-size of the view (take 2 values)
- Parameters
-
HalfWidth | : New half-width |
HalfHeight | : New half-height |
Change the half-size of the view (take a vector)
- Parameters
-
void sf::View::Zoom |
( |
float |
Factor | ) |
|
Resize the view rectangle to simulate a zoom / unzoom effect.
- Parameters
-
Factor | : Zoom factor to apply, relative to the current zoom |
The documentation for this class was generated from the following file: