API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceApplicationOptions

@codexo/exojs / core / stable

15
props
0
methods
0
events
Import
import { ApplicationOptions } from '@codexo/exojs'
Properties15
autoClear?: boolean
Clear the canvas to ApplicationOptions.clearColor at the start of every frame, before the scene draws. Default true - a scene's draw() therefore paints onto a fresh frame and needs no clear of its own. Set false for pipelines that own the whole frame themselves: feedback / trail effects that deliberately keep the previous frame, or a custom renderer that issues its own clear as part of its first pass. Nothing else changes - Application.clearColor is still the colour a manual context.clear(app.clearColor) would use.
backend?: BackendConfig
The colour every frame starts from. Applied by the engine's own per-frame clear (see ApplicationOptions.autoClear) and readable/assignable later as Application.clearColor. Default: opaque black.
Whether the application may reach the network, and what the host reports about it. Defaults to one built over ApplicationOptions.platform. Pass your own when something outside the application needs the same instance - a ConnectivityPolicyResolver is configured on an AssetCache the caller builds, which happens before an Application exists to own one. An injected Connectivity is *not* destroyed by Application.destroy - it stays yours to dispose.
displayFrameTime?: number
Duration of one display frame in **seconds**, the target a frame has to stay inside for FrameBudget.timeRemaining to report time left. Omit it and the engine estimates the display's cadence as the minimum frame delta over a rolling window, requestAnimationFrame being vsync-locked. Pass it to pin the target instead: a deterministic figure for a test, or an application that deliberately aims at a rate other than the display's.
Extension selection - the only way an Application is equipped. undefined or [] → Core only. [a, b, ...] → Core plus exactly these. There is no global registry to fall back on: what an application can do is decided here, at its construction, and nowhere else. That is what lets two Applications in one process hold different extension sets - an editor next to its runtime preview, two canvases with different renderers, a test that must not see what a neighbouring test installed. ts import { tilemapExtension } from '@codexo/exojs-tilemap'; const app = new Application({ extensions: [tilemapExtension] }); Materialised once at construction.
fixedTimeStep?: number
Fixed-timestep size in **seconds** for Scene.fixedUpdate / Application.onFixedFrame. Default 1 / 60. Must be positive.
hello?: boolean
Print the one-time ExoJS v{version} startup banner to the console on Application.start. Development-only (no-op in production builds) and printed at most once per process regardless of how many Applications are constructed. Default true.
Host seam the application runs on - surface focus and geometry, cursor, touch-action, pointer capture, gamepad polling, document visibility, frame scheduling, and input-event delivery. Defaults to a BrowserPlatform bound to the application's canvas. Pass your own to host the engine somewhere other than a plain DOM canvas, or to drive input and the frame loop from a test without monkey-patching globals. An injected adapter is *not* destroyed by Application.destroy - it stays yours to dispose.
scenes?: Registry
Registry of navigable Scene constructors, keyed by a name used for diagnostics (shown in UnregisteredSceneError messages and duplicate-registration errors) and for key-based navigation. Each value is either a bare Scene subclass constructor, or a { scene, transition? } descriptor pairing one with a target-bound default transition, consulted by SceneDirector.change/ SceneDirector.restore whenever navigation targets this constructor without its own call-site transition option - see SceneRegistration. Required for any Application.start / SceneDirector.change call that targets a constructor - unregistered targets reject in development builds. Validated once at construction: every value must resolve to a Scene subclass constructor (checked without instantiating it), and no constructor may appear under more than one key.
seed?: number
Seed for the per-Application Application.random RNG. Omit for a non-deterministic seed.
Source