API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classView
2D camera that defines what region of the world is visible on screen. Maintains a center position, a visible area size, a rotation, and an optional zoom level. Provides lazy-evaluated world-to-clip and clip-to-world transform matrices, a follow-target system for tracking scene nodes, and a procedural screen-shake effect. Call update once per frame to advance follow and shake animations.
import { View } from '@codexo/exojs'2D camera that defines what region of the world is visible on screen.
Maintains a center position, a visible area size, a rotation, and an optional zoom level. Provides lazy-evaluated world-to-clip and clip-to-world transform matrices, a follow-target system for tracking scene nodes, and a procedural screen-shake effect. Call update once per frame to advance follow and shake animations.
new(centerX: number, centerY: number, width: number, height: number): ViewclearBounds(): thisclearFollow(): thisclearShake(): thisdestroy(): voidgetBounds(out?: RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…): RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…move(x: number, y: number): thisreset(centerX: number, centerY: number, width: number, height: number): thisresize(width: number, height: number): thisrotate(degrees: number): thisscreenToWorld(x: number, y: number): PointLikeStructural type for any object with a 2D `x`/`y` position.screenToWorld(screenX: number, screenY: number, canvasWidth: number, canvasHeight: number): PointLikeStructural type for any object with a 2D `x`/`y` position.setCenter(x: number, y: number): thissetRotation(degrees: number): thissetViewport(x: number, y: number, width: number, height: number): thissetZoom(zoom: number): thisshake(intensity: number, duration: SecondsA length of time in seconds. The unit every duration in the public API is expressed in - frame deltas, the fixed step, elapsed totals, timer limits. It is a `n…, options: ViewShakeOptionsOptions for View.shake.): thisupdate(deltaMilliseconds: number): thisupdateBounds(): thisupdateTransform(): thisworldToScreen(worldX: number, worldY: number): PointLikeStructural type for any object with a 2D `x`/`y` position.worldToScreen(worldX: number, worldY: number, canvasWidth: number, canvasHeight: number): PointLikeStructural type for any object with a 2D `x`/`y` position.zoom(factor: number): thiszoomIn(amount: number): thiszoomOut(amount: number): thisfrom(options: ViewOptionsOptions for View.from.): Viewdestroyed: booleanheight: numberrotation: numberupdateId: numberwidth: numberzoomLevel: number