Kraken Logo

Kraken Engine

DocumentationGuidesShowcaseCommunity
Ctrl
K
Navigating the Docs
Building Docs
Overview
Camera
Color
Draw
Ease
Event
Fx
Gamepad
Input
Log
Math
Mixer
Mouse
Physics
Pixel Array
Renderer
Shaders
Time
Transform
Ui
Viewport
Window

Built bydurkisneer1.Kraken Engine is open source and available onGitHub.

  1. Docs
  2. Functions
  3. Camera

Camera

Camera management and coordinate conversion


Get Active Pos

get_active_pos() → Vec2get_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.

Get Active Angle

get_active_angle() → floatget_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.

World To Screen

world_to_screen(world_pos: Vec2) → Vec2world_to_screen(world_pos: Vec2) → Vec2

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

Args

  • world_pos : The world position to convert.

Returns

Vec2 : The resulting screen position.

Screen To World

screen_to_world(screen_pos: Vec2) → Vec2screen_to_world(screen_pos: Vec2) → Vec2

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

Args

  • screen_pos : The screen position to convert.

Returns

Vec2 : The resulting world position.

PreviousOverview
NextColor

On this page

Get Active PosGet Active AngleWorld To ScreenScreen To World