App
此内容尚不支持你的语言。
Defined in: app.ts:71
Accessors
Section titled “Accessors”isPhysicsReady
Section titled “isPhysicsReady”Get Signature
Section titled “Get Signature”get isPhysicsReady():
boolean
Defined in: app.ts:436
Returns
Section titled “Returns”boolean
pipeline
Section titled “pipeline”Get Signature
Section titled “Get Signature”get pipeline():
RenderPipeline|null
Defined in: app.ts:411
Returns
Section titled “Returns”RenderPipeline | null
sideModules
Section titled “sideModules”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”SideModuleHost | null
spineInitPromise
Section titled “spineInitPromise”Get Signature
Section titled “Get Signature”get spineInitPromise():
Promise<unknown> |undefined
Defined in: app.ts:419
Returns
Section titled “Returns”Promise<unknown> | undefined
Set Signature
Section titled “Set Signature”set spineInitPromise(
p):void
Defined in: app.ts:423
Parameters
Section titled “Parameters”Promise<unknown> | undefined
Returns
Section titled “Returns”void
subsystems
Section titled “subsystems”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”wasmModule
Section titled “wasmModule”Get Signature
Section titled “Get Signature”get wasmModule():
ESEngineModule|null
Defined in: app.ts:407
Returns
Section titled “Returns”ESEngineModule | null
Get Signature
Section titled “Get Signature”get world():
World
Defined in: app.ts:445
Returns
Section titled “Returns”Methods
Section titled “Methods”addEvent()
Section titled “addEvent()”addEvent<
T>(event):this
Defined in: app.ts:228
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”EventDef<T>
Returns
Section titled “Returns”this
addPlugin()
Section titled “addPlugin()”addPlugin(
plugin):this
Defined in: app.ts:174
Parameters
Section titled “Parameters”plugin
Section titled “plugin”Returns
Section titled “Returns”this
addPlugins()
Section titled “addPlugins()”addPlugins(
plugins):this
Defined in: app.ts:166
Parameters
Section titled “Parameters”plugins
Section titled “plugins”Plugin[]
Returns
Section titled “Returns”this
addStartupSystem()
Section titled “addStartupSystem()”addStartupSystem(
system):this
Defined in: app.ts:266
Parameters
Section titled “Parameters”system
Section titled “system”Returns
Section titled “Returns”this
addSystem()
Section titled “addSystem()”addSystem(
system):this
Defined in: app.ts:262
Parameters
Section titled “Parameters”system
Section titled “system”Returns
Section titled “Returns”this
addSystemSet()
Section titled “addSystemSet()”addSystemSet(
set):this
Defined in: app.ts:367
Shortcut for addSystemSetToSchedule(Schedule.Update, set).
Parameters
Section titled “Parameters”SystemSet
Returns
Section titled “Returns”this
addSystemSetToSchedule()
Section titled “addSystemSetToSchedule()”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.
Parameters
Section titled “Parameters”schedule
Section titled “schedule”SystemSet
Returns
Section titled “Returns”this
addSystemToSchedule()
Section titled “addSystemToSchedule()”addSystemToSchedule(
schedule,system,options?):this
Defined in: app.ts:237
Parameters
Section titled “Parameters”schedule
Section titled “schedule”system
Section titled “system”options?
Section titled “options?”runAfter?
Section titled “runAfter?”string[]
runBefore?
Section titled “runBefore?”string[]
runIf?
Section titled “runIf?”Returns
Section titled “Returns”this
connectCpp()
Section titled “connectCpp()”connectCpp(
cppRegistry,module?,options?):this
Defined in: app.ts:393
Parameters
Section titled “Parameters”cppRegistry
Section titled “cppRegistry”module?
Section titled “module?”options?
Section titled “options?”BridgeConnectOptions
Returns
Section titled “Returns”this
enableStats()
Section titled “enableStats()”enableStats():
this
Defined in: app.ts:520
Returns
Section titled “Returns”this
getEntityCount()
Section titled “getEntityCount()”getEntityCount():
number
Defined in: app.ts:562
Returns
Section titled “Returns”number
getFixedTimestep()
Section titled “getFixedTimestep()”getFixedTimestep():
number
Defined in: app.ts:459
The fixed-update timestep (seconds) — the FixedUpdate / physics cadence.
Returns
Section titled “Returns”number
getFrameScopes()
Section titled “getFrameScopes()”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.
Returns
Section titled “Returns”ReadonlyMap<string, number> | null
getPhaseTimings()
Section titled “getPhaseTimings()”getPhaseTimings():
ReadonlyMap<string,number> |null
Defined in: app.ts:532
Returns
Section titled “Returns”ReadonlyMap<string, number> | null
getPlaySpeed()
Section titled “getPlaySpeed()”getPlaySpeed():
number
Defined in: app.ts:512
Returns
Section titled “Returns”number
getPlugin()
Section titled “getPlugin()”getPlugin<
T>(ctor):T|undefined
Defined in: app.ts:144
Type Parameters
Section titled “Type Parameters”T extends Plugin
Parameters
Section titled “Parameters”(…args) => T
Returns
Section titled “Returns”T | undefined
getRegisteredResourceNames()
Section titled “getRegisteredResourceNames()”getRegisteredResourceNames():
string[]
Defined in: app.ts:593
Returns
Section titled “Returns”string[]
getResource()
Section titled “getResource()”getResource<
T>(resource):T
Defined in: app.ts:575
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”resource
Section titled “resource”ResourceDef<T>
Returns
Section titled “Returns”T
getResourceByName()
Section titled “getResourceByName()”getResourceByName(
name):unknown
Defined in: app.ts:583
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”unknown
getResourceChangeTick()
Section titled “getResourceChangeTick()”getResourceChangeTick(
name):number
Defined in: app.ts:588
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”number
getSystemTimings()
Section titled “getSystemTimings()”getSystemTimings():
ReadonlyMap<string,number> |null
Defined in: app.ts:528
Returns
Section titled “Returns”ReadonlyMap<string, number> | null
getTargetFrameRate()
Section titled “getTargetFrameRate()”getTargetFrameRate():
number
Defined in: app.ts:508
Returns
Section titled “Returns”number
hasResource()
Section titled “hasResource()”hasResource<
T>(resource):boolean
Defined in: app.ts:579
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”resource
Section titled “resource”ResourceDef<T>
Returns
Section titled “Returns”boolean
hotSwapSystems()
Section titled “hotSwapSystems()”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.
Parameters
Section titled “Parameters”incoming
Section titled “incoming”readonly object[]
Returns
Section titled “Returns”boolean
insertResource()
Section titled “insertResource()”insertResource<
T>(resource,value):this
Defined in: app.ts:570
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”resource
Section titled “resource”ResourceDef<T>
T
Returns
Section titled “Returns”this
isPaused()
Section titled “isPaused()”isPaused():
boolean
Defined in: app.ts:492
Returns
Section titled “Returns”boolean
measureFrameScope()
Section titled “measureFrameScope()”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.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
() => T
Returns
Section titled “Returns”T
onError()
Section titled “onError()”onError(
handler):this
Defined in: app.ts:473
Parameters
Section titled “Parameters”handler
Section titled “handler”(error, systemName) => void
Returns
Section titled “Returns”this
onSystemError()
Section titled “onSystemError()”onSystemError(
handler):this
Defined in: app.ts:478
Parameters
Section titled “Parameters”handler
Section titled “handler”(error, systemName?) => "pause" | "continue"
Returns
Section titled “Returns”this
onWasmError()
Section titled “onWasmError()”onWasmError(
handler):this
Defined in: app.ts:483
Parameters
Section titled “Parameters”handler
Section titled “handler”(error, context) => void
Returns
Section titled “Returns”this
quit()
Section titled “quit()”quit(
options?):void
Defined in: app.ts:677
Parameters
Section titled “Parameters”options?
Section titled “options?”keepRenderer?
Section titled “keepRenderer?”boolean
Returns
Section titled “Returns”void
registerScene()
Section titled “registerScene()”registerScene(
config):this
Defined in: app.ts:601
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”this
removeSystem()
Section titled “removeSystem()”removeSystem(
systemId):boolean
Defined in: app.ts:371
Parameters
Section titled “Parameters”systemId
Section titled “systemId”symbol
Returns
Section titled “Returns”boolean
run():
Promise<void>
Defined in: app.ts:631
Returns
Section titled “Returns”Promise<void>
setFixedTimestep()
Section titled “setFixedTimestep()”setFixedTimestep(
timestep):this
Defined in: app.ts:453
Parameters
Section titled “Parameters”timestep
Section titled “timestep”number
Returns
Section titled “Returns”this
setInitialScene()
Section titled “setInitialScene()”setInitialScene(
name):this
Defined in: app.ts:606
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
setMaxDeltaTime()
Section titled “setMaxDeltaTime()”setMaxDeltaTime(
v):this
Defined in: app.ts:463
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
setMaxFixedSteps()
Section titled “setMaxFixedSteps()”setMaxFixedSteps(
v):this
Defined in: app.ts:468
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
setPaused()
Section titled “setPaused()”setPaused(
paused):void
Defined in: app.ts:488
Parameters
Section titled “Parameters”paused
Section titled “paused”boolean
Returns
Section titled “Returns”void
setPipeline()
Section titled “setPipeline()”setPipeline(
pipeline):void
Defined in: app.ts:415
Parameters
Section titled “Parameters”pipeline
Section titled “pipeline”Returns
Section titled “Returns”void
setPlaySpeed()
Section titled “setPlaySpeed()”setPlaySpeed(
speed):void
Defined in: app.ts:500
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
setSideModules()
Section titled “setSideModules()”setSideModules(
host):void
Defined in: app.ts:162
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
setTargetFrameRate()
Section titled “setTargetFrameRate()”setTargetFrameRate(
fps):void
Defined in: app.ts:504
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
stepFrame()
Section titled “stepFrame()”stepFrame():
void
Defined in: app.ts:496
Returns
Section titled “Returns”void
tick()
Section titled “tick()”tick(
delta):Promise<void>
Defined in: app.ts:615
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<void>
waitForPhysics()
Section titled “waitForPhysics()”waitForPhysics():
Promise<void>
Defined in: app.ts:427
Returns
Section titled “Returns”Promise<void>
staticnew():App
Defined in: app.ts:136
Returns
Section titled “Returns”App