Camera

Functions in camera.


Get Active Pos

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.

World To Screen

world_to_screen(world_pos: Vec2) Vec2

Convert a world position to a screen position using the active camera's translation.

Args

  • world_pos : The world position to convert.

Returns

Vec2 : The resulting screen position.

Screen To World

screen_to_world(screen_pos: Vec2) Vec2

Convert a screen position to a world position using the active camera's translation.

Args

  • screen_pos : The screen position to convert.

Returns

Vec2 : The resulting world position.