Kraken Logo

Kraken Engine

DocumentationGuidesShowcaseCommunity
Ctrl
K
Navigating the Docs
Building Docs
Overview
Anchor
AnimationController
Audio
Batcher
Body
Camera
Capsule
CastHit
CharacterBody
Circle
Collision
Color
DistanceJoint
Effect
Event
FilterJoint
Flip (Texture)
Font
ImageLayer
InputAction
Joint
Layer
Line
Map
MapObject
Mask
MotorJoint
MouseJoint
ObjectGroup
Orchestrator
PixelArray
PolarCoordinate
Polygon
PrismaticJoint
Rect
RevoluteJoint
RigidBody
Sample
Sampler
Shader
SheetStrip
StaticBody
Stream
Style
Terrain (TileSet)
Text
TextProperties
Texture
Tile (TileLayer)
Tile (TileSet)
TileLayer
TileResult (TileLayer)
TileSet
Timer
Transform
Tween
Vec2
Vertex
WeldJoint
WheelJoint
World

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

  1. Docs
  2. Classes
  3. Camera

Camera

Represents a 2D camera used for rendering.

Constructor

  • Camera(set_active: bool = False) → CameraCamera(set_active: bool = False) → Camera

Represents a 2D camera used for rendering.

Properties


NameDescriptionType
transformThe camera transform. transform.pos is the world point at the center of the view.Transform

Methods


Move Screen

move_screen(delta: Vec2) → Nonemove_screen(delta: Vec2) → None

Move the camera by a delta in screen/camera space.

Args

  • delta : Screen-space movement delta.

Move World

move_world(delta: Vec2) → Nonemove_world(delta: Vec2) → None

Move the camera by a delta in world space.

Args

  • delta : World movement delta.

Rotate

rotate(delta: float) → Nonerotate(delta: float) → None

Rotate the camera view by a delta in radians.

Args

  • delta : Angle delta in radians.

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 this camera.

Args

  • screen_pos : The screen position to convert.

Returns

Vec2 : The resulting world position.

Set

set() → Noneset() → None

Set this camera as the active one for rendering.

Only one camera can be active at a time.

Unset

unset() → Noneunset() → None

Unset this camera as the active one for rendering.

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 this camera.

Args

  • world_pos : The world position to convert.

Returns

Vec2 : The resulting screen position.

PreviousBody
NextCapsule

On this page

ConstructorPropertiesMethodsMove ScreenMove WorldRotateScreen To WorldSetUnsetWorld To Screen