Header menu logo Mibo

Camera2D Type

A 2D camera definition for the MonoGame backend. Produces a transform matrix for SpriteBatch.Begin.

Mirrors the raylib Camera2D concept: position, zoom, rotation, and origin. Use Camera2D.create to construct one and Camera2D.toMatrix to get the SpriteBatch transform.

Record fields

Record Field Description

Origin

Full Usage: Origin

Field type: Vector2

The point on screen where the camera is anchored (typically viewport center).

Field type: Vector2

Position

Full Usage: Position

Field type: Vector2

World position the camera is centered on.

Field type: Vector2

Rotation

Full Usage: Rotation

Field type: float32

Rotation in radians around the origin.

Field type: float32

Zoom

Full Usage: Zoom

Field type: float32

Zoom factor (1.0 = no zoom, >1 = zoom in, <1 = zoom out).

Field type: float32

Type something to start searching.