Skip to content

Components

Camera

The view a room is seen through. Only one should be active in a scene at a time, and it decides magnification, roll and how the visible area scales with the window.

On this page

Add it

+ Add node → Camera, Pixel Perfect Camera, Camera Rig creates a node with it already on. Already have a node for it? Add component → CameraComponent.

From a script

A script on the same node writes these fields by name. CameraComponent is the name to pass.

rgs
set_flag("CameraComponent", "active", true);
set_number("CameraComponent", "zoom", 1.0);
set_number("CameraComponent", "rotation", 0.0);
set_point("CameraComponent", "offset", vec2(0.0, 0.0));
set_number("CameraComponent", "extent", 360.0);
set_number("CameraComponent", "width", 640.0);
set_flag("CameraComponent", "pixel_snap", true);
set_colour("CameraComponent", "background", vec4(0.0021246888, 0.0033465356, 0.0033465356, 1.0));

Fields

FieldScript nameKindDefaultWhat it does
ActiveactivecheckboxonWhether this camera drives the view.
Zoomzoomnumber, 0.01 to 64, step 0.011Magnification. Greater than one zooms in.
Rotationrotationnumber, step 10 °Dutch angle; zero is level.
Offsetoffsettwo numbers (x, y)(0, 0)Moves the picture without moving the camera: what a script's camera_view() sees and the room's confiner stay where the camera rests. A script's shake() is drawn on top and never written here.
Scalingscalingone of Pixels, FixedVertical, FixedHorizontal, LetterboxPixelsHow the camera works out how much of the world to show.
Extentextentnumber, at least 1360 uHow much of the world the view shows: its height for Fixed Vertical and Letterbox, its width for Fixed Horizontal.
Widthwidthnumber, at least 1640 uHow wide the view is when Scaling is set to Letterbox.
Pixel Snappixel_snapcheckboxonStops pixel art shimmering as the camera moves.
Backgroundbackgroundcolour#010101The colour behind everything this camera shows, and in the bars of a Letterbox; always drawn fully opaque.