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.
◆ View() [1/2]
Construct the view from a rectangle.
- Parameters
-
ViewRect | : Rectangle defining the position and size of the view (1000x1000 by default) |
Definition at line 37 of file View.cpp.
◆ View() [2/2]
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) |
Definition at line 46 of file View.cpp.
◆ GetCenter()
Get the center of the view.
- Returns
- Center of the view
Definition at line 108 of file View.cpp.
◆ GetHalfSize()
Get the half-size of the view.
- Returns
- Half-size of the view
Definition at line 117 of file View.cpp.
◆ GetRect()
Get the bounding rectangle of the view.
- Returns
- Bounding rectangle of the view
Definition at line 126 of file View.cpp.
◆ Move() [1/2]
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 |
Definition at line 139 of file View.cpp.
◆ Move() [2/2]
Move the view (take a vector)
- Parameters
-
Offset | : Offset to move the view |
Definition at line 150 of file View.cpp.
◆ SetCenter() [1/2]
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 |
Definition at line 58 of file View.cpp.
◆ SetCenter() [2/2]
Change the center of the view (take a vector)
- Parameters
-
Definition at line 69 of file View.cpp.
◆ SetFromRect()
void sf::View::SetFromRect |
( |
const FloatRect & |
ViewRect | ) |
|
Rebuild the view from a rectangle.
- Parameters
-
ViewRect | : Rectangle defining the position and size of the view |
Definition at line 98 of file View.cpp.
◆ SetHalfSize() [1/2]
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 |
Definition at line 78 of file View.cpp.
◆ SetHalfSize() [2/2]
Change the half-size of the view (take a vector)
- Parameters
-
Definition at line 89 of file View.cpp.
◆ Zoom()
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 |
Definition at line 159 of file View.cpp.
The documentation for this class was generated from the following files: