C# Class SFML.Graphics.View

This class defines a view (position, size, etc.) ; you can consider it as a 2D camera
See also the note on coordinates and undistorted rendering in SFML.Graphics.Transformable.
Inheritance: SFML.System.ObjectBase
Mostra file Open project: SFML/SFML.Net Class Usage Examples

Public Methods

Method Description
Move ( Vector2f offset ) : void

Move the view

Reset ( FloatRect rectangle ) : void

Rebuild the view from a rectangle

Rotate ( float angle ) : void

Rotate the view

ToString ( ) : string

Provide a string describing the object

View ( ) : System

Create a default view (1000x1000)

View ( FloatRect viewRect ) : System

Construct the view from a rectangle

View ( Vector2f center, Vector2f size ) : System

Construct the view from its center and size

View ( View copy ) : System

Construct the view from another view

Zoom ( float factor ) : void

Resize the view rectangle to simulate a zoom / unzoom effect

Protected Methods

Method Description
Destroy ( bool disposing ) : void

Handle the destruction of the object

Private Methods

Method Description
View ( IntPtr cPointer ) : System

Internal constructor for other classes which need to manipulate raw views

sfView_copy ( IntPtr View ) : IntPtr
sfView_create ( ) : IntPtr
sfView_createFromRect ( FloatRect Rect ) : IntPtr
sfView_destroy ( IntPtr View ) : void
sfView_getCenter ( IntPtr View ) : Vector2f
sfView_getRotation ( IntPtr View ) : float
sfView_getSize ( IntPtr View ) : Vector2f
sfView_getViewport ( IntPtr View ) : FloatRect
sfView_move ( IntPtr View, Vector2f offset ) : void
sfView_reset ( IntPtr View, FloatRect Rectangle ) : void
sfView_rotate ( IntPtr View, float Angle ) : void
sfView_setCenter ( IntPtr View, Vector2f center ) : void
sfView_setRotation ( IntPtr View, float Angle ) : void
sfView_setSize ( IntPtr View, Vector2f size ) : void
sfView_setViewport ( IntPtr View, FloatRect Viewport ) : void
sfView_zoom ( IntPtr View, float Factor ) : void

Method Details

Destroy() protected method

Handle the destruction of the object
protected Destroy ( bool disposing ) : void
disposing bool Is the GC disposing the object, or is it an explicit call ?
return void

Move() public method

Move the view
public Move ( Vector2f offset ) : void
offset Vector2f Offset to move the view
return void

Reset() public method

Rebuild the view from a rectangle
public Reset ( FloatRect rectangle ) : void
rectangle FloatRect Rectangle defining the position and size of the view
return void

Rotate() public method

Rotate the view
public Rotate ( float angle ) : void
angle float Angle of rotation, in degrees
return void

ToString() public method

Provide a string describing the object
public ToString ( ) : string
return string

View() public method

Create a default view (1000x1000)
public View ( ) : System
return System

View() public method

Construct the view from a rectangle
public View ( FloatRect viewRect ) : System
viewRect FloatRect Rectangle defining the position and size of the view
return System

View() public method

Construct the view from its center and size
public View ( Vector2f center, Vector2f size ) : System
center Vector2f Center of the view
size Vector2f Size of the view
return System

View() public method

Construct the view from another view
public View ( View copy ) : System
copy View View to copy
return System

Zoom() public method

Resize the view rectangle to simulate a zoom / unzoom effect
public Zoom ( float factor ) : void
factor float Zoom factor to apply, relative to the current zoom
return void