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): View clearBounds(): this clearFollow(): this destroy(): void follow(target: ViewFollowTarget, options: ViewFollowOptions): this getBounds(): Rectangle getInverseTransform(): Matrix getTransform(): Matrix move(x: number, y: number): this reset(centerX: number, centerY: number, width: number, height: number): this resize(width: number, height: number): this rotate(degrees: number): this screenToWorld(x: number, y: number): PointLike screenToWorld(screenX: number, screenY: number, canvasWidth: number, canvasHeight: number): PointLike setBounds(bounds: Rectangle | null): this setCenter(x: number, y: number): this setRotation(degrees: number): this setZoom(zoom: number): this shake(intensity: number, durationMs: number, options: ViewShakeOptions): this stopShake(): this update(deltaMilliseconds: number): this updateBounds(): this updateTransform(): this worldToScreen(worldX: number, worldY: number): PointLike worldToScreen(worldX: number, worldY: number, canvasWidth: number, canvasHeight: number): PointLike zoom(factor: number): this zoomIn(amount: number): this zoomOut(amount: number): this center: ObservableVector height: number rotation: number size: ObservableSize updateId: number viewport: Rectangle width: number zoomLevel: number