#include <SFML/Graphics/Export.h>#include <SFML/Graphics/Rect.h>#include <SFML/Graphics/Types.h>#include <SFML/System/Vector2.h>Go to the source code of this file.
Functions | |
| CSFML_GRAPHICS_API sfView * | sfView_create (void) |
| Create a default view. More... | |
| CSFML_GRAPHICS_API sfView * | sfView_createFromRect (sfFloatRect rectangle) |
| Construct a view from a rectangle. More... | |
| CSFML_GRAPHICS_API sfView * | sfView_copy (const sfView *view) |
| Copy an existing view. More... | |
| CSFML_GRAPHICS_API void | sfView_destroy (sfView *view) |
| Destroy an existing view. More... | |
| CSFML_GRAPHICS_API void | sfView_setCenter (sfView *view, sfVector2f center) |
| Set the center of a view. More... | |
| CSFML_GRAPHICS_API void | sfView_setSize (sfView *view, sfVector2f size) |
| Set the size of a view. More... | |
| CSFML_GRAPHICS_API void | sfView_setRotation (sfView *view, float angle) |
| Set the orientation of a view. More... | |
| CSFML_GRAPHICS_API void | sfView_setViewport (sfView *view, sfFloatRect viewport) |
| Set the target viewport of a view. More... | |
| CSFML_GRAPHICS_API void | sfView_reset (sfView *view, sfFloatRect rectangle) |
| Reset a view to the given rectangle. More... | |
| CSFML_GRAPHICS_API sfVector2f | sfView_getCenter (const sfView *view) |
| Get the center of a view. More... | |
| CSFML_GRAPHICS_API sfVector2f | sfView_getSize (const sfView *view) |
| Get the size of a view. More... | |
| CSFML_GRAPHICS_API float | sfView_getRotation (const sfView *view) |
| Get the current orientation of a view. More... | |
| CSFML_GRAPHICS_API sfFloatRect | sfView_getViewport (const sfView *view) |
| Get the target viewport rectangle of a view. More... | |
| CSFML_GRAPHICS_API void | sfView_move (sfView *view, sfVector2f offset) |
| Move a view relatively to its current position. More... | |
| CSFML_GRAPHICS_API void | sfView_rotate (sfView *view, float angle) |
| Rotate a view relatively to its current orientation. More... | |
| CSFML_GRAPHICS_API void | sfView_zoom (sfView *view, float factor) |
| Resize a view rectangle relatively to its current size. More... | |
| CSFML_GRAPHICS_API sfView* sfView_copy | ( | const sfView * | view | ) |
Copy an existing view.
| view | View to copy |
| CSFML_GRAPHICS_API sfView* sfView_create | ( | void | ) |
Create a default view.
This function creates a default view of (0, 0, 1000, 1000)
| CSFML_GRAPHICS_API sfView* sfView_createFromRect | ( | sfFloatRect | rectangle | ) |
Construct a view from a rectangle.
| rectangle | Rectangle defining the zone to display |
| CSFML_GRAPHICS_API void sfView_destroy | ( | sfView * | view | ) |
Destroy an existing view.
| view | View to destroy |
| CSFML_GRAPHICS_API sfVector2f sfView_getCenter | ( | const sfView * | view | ) |
Get the center of a view.
| view | View object |
| CSFML_GRAPHICS_API float sfView_getRotation | ( | const sfView * | view | ) |
Get the current orientation of a view.
| view | View object |
| CSFML_GRAPHICS_API sfVector2f sfView_getSize | ( | const sfView * | view | ) |
Get the size of a view.
| view | View object |
| CSFML_GRAPHICS_API sfFloatRect sfView_getViewport | ( | const sfView * | view | ) |
Get the target viewport rectangle of a view.
| view | View object |
| CSFML_GRAPHICS_API void sfView_move | ( | sfView * | view, |
| sfVector2f | offset | ||
| ) |
Move a view relatively to its current position.
| view | View object |
| offset | Offset |
| CSFML_GRAPHICS_API void sfView_reset | ( | sfView * | view, |
| sfFloatRect | rectangle | ||
| ) |
Reset a view to the given rectangle.
Note that this function resets the rotation angle to 0.
| view | View object |
| rectangle | Rectangle defining the zone to display |
| CSFML_GRAPHICS_API void sfView_rotate | ( | sfView * | view, |
| float | angle | ||
| ) |
Rotate a view relatively to its current orientation.
| view | View object |
| angle | Angle to rotate, in degrees |
| CSFML_GRAPHICS_API void sfView_setCenter | ( | sfView * | view, |
| sfVector2f | center | ||
| ) |
Set the center of a view.
| view | View object |
| center | New center |
| CSFML_GRAPHICS_API void sfView_setRotation | ( | sfView * | view, |
| float | angle | ||
| ) |
Set the orientation of a view.
The default rotation of a view is 0 degree.
| view | View object |
| angle | New angle, in degrees |
| CSFML_GRAPHICS_API void sfView_setSize | ( | sfView * | view, |
| sfVector2f | size | ||
| ) |
Set the size of a view.
| view | View object |
| size | New size of the view |
| CSFML_GRAPHICS_API void sfView_setViewport | ( | sfView * | view, |
| sfFloatRect | viewport | ||
| ) |
Set the target viewport of a view.
The viewport is the rectangle into which the contents of the view are displayed, expressed as a factor (between 0 and 1) of the size of the render target to which the view is applied. For example, a view which takes the left side of the target would be defined by a rect of (0, 0, 0.5, 1). By default, a view has a viewport which covers the entire target.
| view | View object |
| viewport | New viewport rectangle |
| CSFML_GRAPHICS_API void sfView_zoom | ( | sfView * | view, |
| float | factor | ||
| ) |
Resize a view rectangle relatively to its current size.
Resizing the view simulates a zoom, as the zone displayed on screen grows or shrinks. factor is a multiplier:
| view | View object |
| factor | Zoom factor to apply |