Camera is a component that represents a game camera. Holds camera information such as viewport info, aspect info and the background color. In-game camera position should be managed in the transform.
Table of contents
Inherited from: Component
• backgroundColor: Color
Background colour for the camera when rendering.
• key: string
• viewportPosition: Vector
Position of the camera's viewport on the screen, with from bottom left (-1, -1) to top right (1, 1) with (0, 0) as the center.
• viewportScale: Vector
Scale of the camera's viewport, relative to the canvas/rendering surface. A viewport scale of (1, 1) would take up the entire canvas, while a scale of (0.5, 0.5) would only take up half of the screen (width and height).
• virtualScale: Vector
The scale of the camera in terms of world space. A virtual scale of (160, 90) would render 160 world space units wide and 90 world space units tall, centered on the camera's transform position.
Static KEY: camera= "camera"
Static MESSAGE_ADD: component_add= "component_add"
Static MESSAGE_REMOVE: component_remove= "component_remove"
▸ Free(): void
▸ GetProjectionMatrix(): Matrix4D
GetProjectionMatrix builds and returns an orthographic projection for use in rendering, based on the virtual scale defined in the camera.
The projection matrix