camera
pykraken.camera Camera management and coordinate conversion
At a glance
4 membersReference
PYTHON APIget_active_angle
functionget_active_angle() -> floatGet 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
functionget_active_pos() -> Vec2Get 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
functionConvert 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
functionConvert 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.