This class defines a view (position, size, etc.) ; you can consider it as a 2D camera.
More...
#include <SFML/Graphics/View.hpp>
|
| | View (const FloatRect &ViewRect=FloatRect(0, 0, 1000, 1000)) |
| | Construct the view from a rectangle.
|
| | View (const sf::Vector2f &Center, const sf::Vector2f &HalfSize) |
| | Construct the view from its center and half-size.
|
| void | SetCenter (float X, float Y) |
| | Change the center of the view (take 2 values).
|
| void | SetCenter (const sf::Vector2f &Center) |
| | Change the center of the view (take a vector).
|
| void | SetHalfSize (float HalfWidth, float HalfHeight) |
| | Change the half-size of the view (take 2 values).
|
| void | SetHalfSize (const sf::Vector2f &HalfSize) |
| | Change the half-size of the view (take a vector).
|
| void | SetFromRect (const FloatRect &ViewRect) |
| | Rebuild the view from a rectangle.
|
| const sf::Vector2f & | GetCenter () const |
| | Get the center of the view.
|
| const sf::Vector2f & | GetHalfSize () const |
| | Get the half-size of the view.
|
| const sf::FloatRect & | GetRect () const |
| | Get the bounding rectangle of the view.
|
| void | Move (float OffsetX, float OffsetY) |
| | Move the view (take 2 values).
|
| void | Move (const sf::Vector2f &Offset) |
| | Move the view (take a vector).
|
| void | Zoom (float Factor) |
| | Resize the view rectangle to simulate a zoom / unzoom effect.
|
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) |
◆ 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) |
◆ GetCenter()
Get the center of the view.
- Returns
- Center of the view
◆ GetHalfSize()
Get the half-size of the view.
- Returns
- Half-size of the view
◆ GetRect()
Get the bounding rectangle of the view.
- Returns
- Bounding rectangle of the view
◆ Move() [1/2]
Move the view (take a vector).
- Parameters
-
| Offset | : Offset to move the view |
◆ Move() [2/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 |
◆ SetCenter() [1/2]
Change the center of the view (take a vector).
- Parameters
-
◆ SetCenter() [2/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 |
◆ 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 |
◆ SetHalfSize() [1/2]
Change the half-size of the view (take a vector).
- Parameters
-
◆ SetHalfSize() [2/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 |
◆ 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 |
◆ RenderTarget
| friend class RenderTarget |
|
friend |
The documentation for this class was generated from the following file: