API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classApplication
Top-level engine instance. Owns the canvas, render backend, scene-stack controller, the core systems (input, interaction, audio, coroutines, tweens, animations, rendering), the app-level SystemRegistry for user/extension systems, asset loader, and the per-frame loop. Lifecycle: construct with options → `await app.start(scene)` → engine runs the request-animation-frame loop until `app.stop()` or `app.destroy()`. The render backend is chosen and initialized during `start()`; query Application.backend or Application.capabilities after start has resolved. The class exposes Signals for the major state-change points (Application.onResize, Application.onFrame, Application.onCanvasFocusChange, Application.onVisibilityChange, Application.onBackendLost, Application.onBackendRestored) so subscribers can react without subclassing. `pauseOnHidden = true` short-circuits the per-frame work while `document.hidden` is true (still consumes RAF callbacks but skips scene update + render). Useful for games; leave off for tools and background-active simulations. **Several applications on one page** are a supported shape, and each owns its surface, backend, scene stack, core systems, extension set, asset loader, frame loop, RNG and changed-record index. Two applications therefore neither rotate each other's retained-plan window nor make each other's scene mutations record anything. What they do share is the process: the Web Audio context (deliberately, since a browser admits only a few) and the monotonic revision counters the scene graph stamps nodes with, which advance faster with a second application but are only ever compared per node. A scene node belongs to exactly one application at a time, and moving one across is an ordinary reparent - its retained state travels with it.
import { Application } from '@codexo/exojs'Top-level engine instance. Owns the canvas, render backend, scene-stack controller, the core systems (input, interaction, audio, coroutines, tweens, animations, rendering), the app-level SystemRegistry for user/extension systems, asset loader, and the per-frame loop.
Lifecycle: construct with options → `await app.start(scene)` → engine runs the request-animation-frame loop until `app.stop()` or `app.destroy()`. The render backend is chosen and initialized during `start()`; query Application.backend or Application.capabilities after start has resolved.
The class exposes Signals for the major state-change points (Application.onResize, Application.onFrame, Application.onCanvasFocusChange, Application.onVisibilityChange, Application.onBackendLost, Application.onBackendRestored) so subscribers can react without subclassing.
`pauseOnHidden = true` short-circuits the per-frame work while `document.hidden` is true (still consumes RAF callbacks but skips scene update + render). Useful for games; leave off for tools and background-active simulations.
**Several applications on one page** are a supported shape, and each owns its surface, backend, scene stack, core systems, extension set, asset loader, frame loop, RNG and changed-record index. Two applications therefore neither rotate each other's retained-plan window nor make each other's scene mutations record anything.
What they do share is the process: the Web Audio context (deliberately, since a browser admits only a few) and the monotonic revision counters the scene graph stamps nodes with, which advance faster with a second application but are only ever compared per node. A scene node belongs to exactly one application at a time, and moving one across is an ordinary reparent - its retained state travels with it.
new(appSettings: ApplicationOptions<Registry>): Application<Registry>capture(node: RenderNodeSceneNode that can produce visual output. Adds the rendering pipeline features on top of the structural transform/bounds carried by SceneNode: post-process `fi…, options: CaptureOptionsOptions for RenderingContext.capture - allocates a new RenderTexture.): RenderTextureAn off-screen render target that can also be sampled as a texture. Combines RenderTarget (framebuffer attachment) with the sampler parameters of a Texture (sca…destroy(): Promise<void>resize(width: number, height: number): thisscreenToWorld(x: number, y: number): PointLikeStructural type for any object with a 2D `x`/`y` position.setCursor(cursor: HTMLCanvasElement | HTMLImageElement | TextureA static GPU texture sourced from an image, canvas, or video element. Holds the pixel source, its sampling state (ScaleModes, WrapModes) and its upload state (… | string): thisstart(): Promise<Application<Registry>>start(target: K, args: ChangeSceneArgsTuple type for `change()`'s single options parameter: present-and-required whenever `ChangeSceneOptions<Data>` has a required `data` field (`Data` is not `void…<InferSceneDataExtracts the activation-data type a SceneConstructor expects.<Registry[K]>>): Promise<Application<Registry>>start(target: C, args: ChangeSceneArgsTuple type for `change()`'s single options parameter: present-and-required whenever `ChangeSceneOptions<Data>` has a required `data` field (`Data` is not `void…<InferSceneDataExtracts the activation-data type a SceneConstructor expects.<C>>): Promise<Application<Registry>>stop(): thisupdate(timestamp: number): thiselement: HTMLCanvasElement | nullloader: Loaderoptions: ApplicationOptions<Registry>pauseOnHidden: booleanbackend: RenderBackendcanvasFocused: booleancursor: stringdocumentVisible: booleanfixedTimeStep: numberframeAlpha: numberframeCount: numberheight: numberpixelRatio: numberwidth: numberonFixedFrame: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[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…]>onFrame: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[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…]>onResize: SignalLightweight typed event emitter. Each `Signal` represents one named notification channel (e.g. `onResize`, `onFrame`). Listeners are added with Signal.add or S…<[number, number, Application<object>]>