View.h File Reference

#include <SFML/Config.h>
#include <SFML/Graphics/Rect.h>

Go to the source code of this file.


Typedefs

typedef sfView sfView
 This class defines a view (position, size, etc.

Functions

CSFML_API sfViewsfView_Create ()
 Construct a default view (1000x1000).
CSFML_API sfViewsfView_CreateFromRect (sfFloatRect Rect)
 Construct a view from a rectangle.
CSFML_API void sfView_Destroy (sfView *View)
 Destroy an existing view.
CSFML_API void sfView_SetCenter (sfView *View, float X, float Y)
 Change the center of a view.
CSFML_API void sfView_SetHalfSize (sfView *View, float HalfWidth, float HalfHeight)
 Change the half-size of a view.
CSFML_API void sfView_SetFromRect (sfView *View, sfFloatRect ViewRect)
 Rebuild a view from a rectangle.
CSFML_API float sfView_GetCenterX (sfView *View)
 Get the X coordinate of the center of a view.
CSFML_API float sfView_GetCenterY (sfView *View)
 Get the Y coordinate of the center of a view.
CSFML_API float sfView_GetHalfSizeX (sfView *View)
 Get the half-width of the view.
CSFML_API float sfView_GetHalfSizeY (sfView *View)
 Get the half-height of the view.
CSFML_API sfFloatRect sfView_GetRect (sfView *View)
 Get the bounding rectangle of a view.
CSFML_API void sfView_Move (sfView *View, float OffsetX, float OffsetY)
 Move a view.
CSFML_API void sfView_Zoom (sfView *View, float Factor)
 Resize a view rectangle to simulate a zoom / unzoom effect.

Typedef Documentation

typedef struct sfView sfView

This class defines a view (position, size, etc.

) ; you can consider it as a 2D camera

Definition at line 39 of file View.h.


Function Documentation

CSFML_API sfView* sfView_Create (  ) 

Construct a default view (1000x1000).

CSFML_API sfView* sfView_CreateFromRect ( sfFloatRect  Rect  ) 

Construct a view from a rectangle.

Parameters:
Rect : Rectangle defining the bounds of the view

CSFML_API void sfView_Destroy ( sfView View  ) 

Destroy an existing view.

Parameters:
View : View to destroy

CSFML_API float sfView_GetCenterX ( sfView View  ) 

Get the X coordinate of the center of a view.

Parameters:
View : View to read
Returns:
X coordinate of the center of the view

CSFML_API float sfView_GetCenterY ( sfView View  ) 

Get the Y coordinate of the center of a view.

Parameters:
View : View to read
Returns:
Y coordinate of the center of the view

CSFML_API float sfView_GetHalfSizeX ( sfView View  ) 

Get the half-width of the view.

Parameters:
View : View to read
Returns:
Half-width of the view

CSFML_API float sfView_GetHalfSizeY ( sfView View  ) 

Get the half-height of the view.

Parameters:
View : View to read
Returns:
Half-height of the view

CSFML_API sfFloatRect sfView_GetRect ( sfView View  ) 

Get the bounding rectangle of a view.

Parameters:
View : View to read
Returns:
Bounding rectangle of the view

CSFML_API void sfView_Move ( sfView View,
float  OffsetX,
float  OffsetY 
)

Move a view.

Parameters:
View : View to move
OffsetX : Offset to move the view, on X axis
OffsetY : Offset to move the view, on Y axis

CSFML_API void sfView_SetCenter ( sfView View,
float  X,
float  Y 
)

Change the center of a view.

Parameters:
View : View to modify
X : X coordinate of the new center
Y : Y coordinate of the new center

CSFML_API void sfView_SetFromRect ( sfView View,
sfFloatRect  ViewRect 
)

Rebuild a view from a rectangle.

Parameters:
View : View to modify
ViewRect : Rectangle defining the position and size of the view

CSFML_API void sfView_SetHalfSize ( sfView View,
float  HalfWidth,
float  HalfHeight 
)

Change the half-size of a view.

Parameters:
View : View to modify
HalfWidth : New half-width
HalfHeight : New half-height

CSFML_API void sfView_Zoom ( sfView View,
float  Factor 
)

Resize a view rectangle to simulate a zoom / unzoom effect.

Parameters:
View : View to zoom
Factor : Zoom factor to apply, relative to the current zoom