Represents a 2D camera used for rendering.
Represents a 2D camera used for rendering.
| Name | Description | Type |
|---|---|---|
transform | The camera transform. transform.pos is the world point at the center of the view. | Transform |
move_screen(delta: Vec2) → Nonemove_screen(delta: Vec2) → NoneMove the camera by a delta in screen/camera space.
Args
delta : Screen-space movement delta.move_world(delta: Vec2) → Nonemove_world(delta: Vec2) → NoneMove the camera by a delta in world space.
Args
delta : World movement delta.rotate(delta: float) → Nonerotate(delta: float) → NoneRotate the camera view by a delta in radians.
Args
delta : Angle delta in radians.screen_to_world(screen_pos: Vec2) → Vec2screen_to_world(screen_pos: Vec2) → Vec2Convert a screen position to a world position using this camera.
Args
screen_pos : The screen position to convert.Returns
Vec2 : The resulting world position.
set() → Noneset() → NoneSet this camera as the active one for rendering.
Only one camera can be active at a time.
unset() → Noneunset() → NoneUnset this camera as the active one for rendering.