Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

placeCamera2D

placeCamera2D(writer, camera, focus, placeCamera2DOptions?): void

Places a Camera2D’s lens with its frame’s middle at focus, a point on the plane in metres, at the live yaw, pitch and zoom. The camera’s own aim calls it each frame before the plugins’ hooks; a hook calls it too, for a cutscene’s pan or a room scroll, and the frame stays on the pixel grid, since the grid is laid after every hook. The lens’s turn, zoom and frustum are the frame’s: a hook moves the frame through this call, never by writing the lens, and turns it with setCamera2DYaw.

Parameter Type
writer ViewWriter
camera Entity
focus Vector2
placeCamera2DOptions PlaceCamera2DOptions

void