MODULE v1.8.0

camera

pykraken.camera

Camera management and coordinate conversion

Reference

PYTHON API
get_active_angle() -> float

Get the angle of the currently active camera in radians. If no camera is active, returns 0.

Returns

  • float — The angle of the active camera in radians.
get_active_pos() -> Vec2

Get the position of the currently active camera. If no camera is active, returns (0, 0).

Returns

  • Vec2 — The position of the active camera.
screen_to_world(screen_pos: Vec2) -> Vec2

Convert a screen position to a world position using the active camera.

Args

  • screen_pos (Vec2) — The screen position to convert.

Returns

  • Vec2 — The resulting world position.
world_to_screen(world_pos: Vec2) -> Vec2

Convert a world position to a screen position using the active camera.

Args

  • world_pos (Vec2) — The world position to convert.

Returns

  • Vec2 — The resulting screen position.

Find your next step

Start typing to search the manual.