dsfml.graphics.view



class View;
This class defines a view (position, size and zoom) ; you can consider it as a camera

this();
Constructor

Default view (1000 x 1000)

this(Vector2f center, Vector2f halfsize);
Constructor

Params:
Vector2!(float) center center of the view
Vector2!(float) halfsize Half-size of the view (from center to corner)

this(FloatRect rect);
Constructor

Params:
Rect rect Rectangle defining the position and size of the view

void setCenter(float x, float y);
Change the center of the view

Params:
float x X coordinates of the new center
float y Y coordinates of the new center

void setCenter(Vector2!(float) center);
Change the center of the view

Params:
Vector2!(float) center New center

void setHalfSize(float halfWidth, float HalfHeight);
Change the half-size of the view (take 2 values)

Params:
float halfWidth New half-width
halfHeight New half-height

void setHalfSize(Vector2!(float) halfSize);
Change the half-size of the view (take 2 values)

Params:
helfSize New halfsize

void setFromRect(Rect viewRect);
Rebuild the view from a rectangle

Params:

Vector2!(float) GetCenter();
Get the center of the view

Returns:
Center of the view

Vector2!(float) GetHalfSize();
Get the halfsize of the view

Returns:
Halfsize of the view

Rect getRect();
Get the bounding retangle of the view

void move(float offsetX, float offsetY);
Move the view

Params:
float offsetX Offset to move the view, on X axis
float offsetY Offset to move the view, on Y axis

void move(Vector2!(float) offset);
Move the view

Params:
Vector2!(float) offset offsetto move the view

void zoom(float factor);
Resize the view rectangle to simulate a zoom / unzoom effect

Params:
float factor Zoom factor to apply, relative to the current zoom


Page generated by Ddoc.