Skip to main content

Class: CameraComponent

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

The CameraComponent class implements the Component interface and represents a camera in the rendering system. It provides properties for zooming and panning sensitivity, as well as options to restrict zoom levels and enable/disable panning and zooming.

Extends

Constructors

Constructor

new CameraComponent(options): CameraComponent

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

Constructs a new instance of the CameraComponent class with the given options.

Parameters

options

Partial<CameraComponentOptions> = defaultOptions

Partial options to configure the camera component.

Returns

CameraComponent

Overrides

Component.constructor

Properties

isStatic

isStatic: boolean

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

Indicates if the camera is static (non-movable).


maxZoom

maxZoom: number

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

The maximum zoom level allowed.


minZoom

minZoom: number

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

The minimum zoom level allowed.


panInput?

optional panInput: Axis2dAction

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


panSensitivity

panSensitivity: number

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

The sensitivity of the panning controls.


scissorRect?

optional scissorRect: Rect

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


zoom

zoom: number

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

The current zoom level of the camera.


zoomInput?

optional zoomInput: Axis1dAction

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


zoomSensitivity

zoomSensitivity: number

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

The sensitivity of the zoom controls.

Accessors

id

Get Signature

get static id(): symbol

Defined in: ecs/types/Component.ts:12

The unique id of the component.

Returns

symbol

Inherited from

Component.id

Methods

createDefaultCamera()

static createDefaultCamera(isStatic): CameraComponent

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

Creates a default camera component with the option to set it as static.

Parameters

isStatic

boolean = false

Indicates if the camera should be static (default: false).

Returns

CameraComponent

A new CameraComponent instance with default settings.