Skip to main content

Interface: CameraDefaultedOptions

Defined in: rendering/components/camera-component.ts:12

Fields of CameraEcsComponent with a sensible default; callers may omit these.

Extended by

Properties

clearColor

clearColor: Color

Defined in: rendering/components/camera-component.ts:72

The clear color


cullingMask

cullingMask: number

Defined in: rendering/components/camera-component.ts:57

A bitmask matched against each sprite's Renderable.category (matchesMask) to decide whether this camera draws it. Defaults to 0xffffffff (every category) in addCameraComponent.


isStatic

isStatic: boolean

Defined in: rendering/components/camera-component.ts:50

When true, this camera ignores zoomInput and panInput entirely (createCameraEcsSystem returns early for it). Use for cameras whose position and zoom are driven by other means, or that should never move.


layer

layer: number

Defined in: rendering/components/camera-component.ts:67

The draw-order layer for this camera's renderTarget, relative to other cameras presented in the same frame: lower layers are presented (and thus drawn onto the canvas) first, so higher layers appear on top. Only meaningful between cameras with different render targets; has no effect on cameras that share one (they're already composited together before presenting) or that render straight to the canvas.


maxZoom

maxZoom: number

Defined in: rendering/components/camera-component.ts:43

The upper bound zoom is clamped to.


minZoom

minZoom: number

Defined in: rendering/components/camera-component.ts:38

The lower bound zoom is clamped to.


panSensitivity

panSensitivity: number

Defined in: rendering/components/camera-component.ts:33

How strongly panInput moves the camera's position. Scaled by the inverse of the current zoom, so panning covers the same apparent distance on screen at any zoom level.


verticalWorldUnits

verticalWorldUnits: number

Defined in: rendering/components/camera-component.ts:81

The total height, in world units, this camera's view spans vertically. Horizontal extent follows automatically from the destination's aspect ratio, so the same verticalWorldUnits shows the same amount of the world vertically regardless of window size/shape (see calculatePixelsPerUnit). Defaults to 10.


zoom

zoom: number

Defined in: rendering/components/camera-component.ts:19

The current zoom level. Higher values zoom in (the view covers less of the world); lower values zoom out. Adjusted by zoomInput (via zoomSensitivity) when the camera isn't isStatic, and clamped to [minZoom, maxZoom].


zoomSensitivity

zoomSensitivity: number

Defined in: rendering/components/camera-component.ts:26

How strongly zoomInput changes zoom. Applied exponentially (see createCameraEcsSystem) so scrolling has a consistent relative effect regardless of the current zoom level.