Skip to content

App

Defined in: app.ts:71

get isPhysicsReady(): boolean

Defined in: app.ts:436

boolean


get pipeline(): RenderPipeline | null

Defined in: app.ts:411

RenderPipeline | null


get sideModules(): SideModuleHost | null

Defined in: app.ts:158

The realm’s optional-native-module acquirer (physics, spine). Physics and spine pull their wasm from here, so a realm wires its transport once (fetch / inlined / WeChat) and every subsystem follows.

SideModuleHost | null


get spineInitPromise(): Promise<unknown> | undefined

Defined in: app.ts:419

Promise<unknown> | undefined

set spineInitPromise(p): void

Defined in: app.ts:423

Promise<unknown> | undefined

void


get subsystems(): SubsystemRegistry

Defined in: app.ts:151

Subsystem lifecycle registry (“which modules loaded/ready/stepping/errored”). Named plugins auto-register in addPlugin; async plugins (physics) drive their own initializing→ready/error transitions.

SubsystemRegistry


get wasmModule(): ESEngineModule | null

Defined in: app.ts:407

ESEngineModule | null


get world(): World

Defined in: app.ts:445

World

addEvent<T>(event): this

Defined in: app.ts:228

T

EventDef<T>

this


addPlugin(plugin): this

Defined in: app.ts:174

Plugin

this


addPlugins(plugins): this

Defined in: app.ts:166

Plugin[]

this


addStartupSystem(system): this

Defined in: app.ts:266

SystemDef

this


addSystem(system): this

Defined in: app.ts:262

SystemDef

this


addSystemSet(set): this

Defined in: app.ts:367

Shortcut for addSystemSetToSchedule(Schedule.Update, set).

SystemSet

this


addSystemSetToSchedule(schedule, set): this

Defined in: app.ts:330

Register every system in set onto schedule. Each member inherits the set’s runIf (AND-combined with its own if supplied per-system here), and its runBefore / runAfter lists are prepended to the member’s edges. Other systems may reference the set’s name in their own ordering; the scheduler expands those references to every member.

Schedule

SystemSet

this


addSystemToSchedule(schedule, system, options?): this

Defined in: app.ts:237

Schedule

SystemDef

string[]

string[]

RunCondition

this


connectCpp(cppRegistry, module?, options?): this

Defined in: app.ts:393

CppRegistry

ESEngineModule

BridgeConnectOptions

this


enableStats(): this

Defined in: app.ts:520

this


getEntityCount(): number

Defined in: app.ts:562

number


getFixedTimestep(): number

Defined in: app.ts:459

The fixed-update timestep (seconds) — the FixedUpdate / physics cadence.

number


getFrameScopes(): ReadonlyMap<string, number> | null

Defined in: app.ts:542

Sub-frame CPU scopes recorded this frame via measureFrameScope — the finer breakdown within a single system, keyed by scope name. Null when stats aren’t enabled. Sibling of getSystemTimings / getPhaseTimings; surfaces as the profiler’s js.* rows.

ReadonlyMap<string, number> | null


getPhaseTimings(): ReadonlyMap<string, number> | null

Defined in: app.ts:532

ReadonlyMap<string, number> | null


getPlaySpeed(): number

Defined in: app.ts:512

number


getPlugin<T>(ctor): T | undefined

Defined in: app.ts:144

T extends Plugin

(…args) => T

T | undefined


getRegisteredResourceNames(): string[]

Defined in: app.ts:593

string[]


getResource<T>(resource): T

Defined in: app.ts:575

T

ResourceDef<T>

T


getResourceByName(name): unknown

Defined in: app.ts:583

string

unknown


getResourceChangeTick(name): number

Defined in: app.ts:588

string

number


getSystemTimings(): ReadonlyMap<string, number> | null

Defined in: app.ts:528

ReadonlyMap<string, number> | null


getTargetFrameRate(): number

Defined in: app.ts:508

number


hasResource<T>(resource): boolean

Defined in: app.ts:579

T

ResourceDef<T>

boolean


hotSwapSystems(incoming): boolean

Defined in: app.ts:283

Hot-swap the project’s (user-authored) system function bodies in place, keeping the live World/Registry/entities — the state-preserving hot-reload fast path (RC10 P3). incoming is the freshly re-imported bundle’s drained systems.

Returns false when the structure changed — a user system was added, removed, or renamed, or a schedule’s user-system count differs — because the running systems then no longer line up with the new code, so the caller must full-reload instead. Builtin/plugin systems (those with an owning subsystem) are never touched. The match validates fully before mutating, so a rejected swap leaves the scheduler untouched (no torn half-swap). Component identity is stable by name (see component.ts), so the new functions’ queries resolve to the live storage.

readonly object[]

boolean


insertResource<T>(resource, value): this

Defined in: app.ts:570

T

ResourceDef<T>

T

this


isPaused(): boolean

Defined in: app.ts:492

boolean


measureFrameScope<T>(name, fn): T

Defined in: app.ts:551

Time fn as a named sub-frame scope (accumulated if the name repeats in a frame). A no-op passthrough when stats are off, so shipped games pay only a single branch. Use it to split a heavy system into attributable pieces.

T

string

() => T

T


onError(handler): this

Defined in: app.ts:473

(error, systemName) => void

this


onSystemError(handler): this

Defined in: app.ts:478

(error, systemName?) => "pause" | "continue"

this


onWasmError(handler): this

Defined in: app.ts:483

(error, context) => void

this


quit(options?): void

Defined in: app.ts:677

boolean

void


registerScene(config): this

Defined in: app.ts:601

SceneConfig

this


removeSystem(systemId): boolean

Defined in: app.ts:371

symbol

boolean


run(): Promise<void>

Defined in: app.ts:631

Promise<void>


setFixedTimestep(timestep): this

Defined in: app.ts:453

number

this


setInitialScene(name): this

Defined in: app.ts:606

string

this


setMaxDeltaTime(v): this

Defined in: app.ts:463

number

this


setMaxFixedSteps(v): this

Defined in: app.ts:468

number

this


setPaused(paused): void

Defined in: app.ts:488

boolean

void


setPipeline(pipeline): void

Defined in: app.ts:415

RenderPipeline

void


setPlaySpeed(speed): void

Defined in: app.ts:500

number

void


setSideModules(host): void

Defined in: app.ts:162

SideModuleHost

void


setTargetFrameRate(fps): void

Defined in: app.ts:504

number

void


stepFrame(): void

Defined in: app.ts:496

void


tick(delta): Promise<void>

Defined in: app.ts:615

number

Promise<void>


waitForPhysics(): Promise<void>

Defined in: app.ts:427

Promise<void>


static new(): App

Defined in: app.ts:136

App