View

2D camera that defines what region is shown on screen.

Constructors

this
this(FloatRect rectangle)

Construct the view from a rectangle

this
this(Vector2f center, Vector2f size)

Construct the view from its center and size

Members

Functions

getInverseTransform
Transform getInverseTransform()
Transform getInverseTransform()

Get the inverse projection transform of the view.

getTransform
Transform getTransform()
Transform getTransform()

Get the projection transform of the view.

move
void move(Vector2f offset)

Move the view relatively to its current position.

reset
void reset(FloatRect rectangle)

Reset the view to the given rectangle.

zoom
void zoom(float factor)

Resize the view rectangle relatively to its current size.

Properties

center
Vector2f center [@property setter]
Vector2f center [@property getter]

The center of the view.

rotation
float rotation [@property setter]
float rotation [@property getter]

The orientation of the view, in degrees. The default rotation is 0 degrees.

size
Vector2f size [@property setter]
Vector2f size [@property getter]

The size of the view. The default size is (1, 1).

viewport
FloatRect viewport [@property setter]
FloatRect viewport [@property getter]

The target viewpoirt.

Meta