Inspector
Defined in: Inspector.ts:309
Programmatic runtime control and state queries for testing and debugging.
Exposed on window.__yage__ in debug mode.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Inspector(
engine):Inspector
Defined in: Inspector.ts:539
Parameters
Section titled “Parameters”engine
Section titled “engine”EngineRef
Returns
Section titled “Returns”Inspector
Properties
Section titled “Properties”capture
Section titled “capture”
readonlycapture:object
Defined in: Inspector.ts:515
dataURL
Section titled “dataURL”dataURL: () =>
Promise<string>
Returns
Section titled “Returns”Promise<string>
png: () =>
Promise<Uint8Array<ArrayBufferLike>>
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
pngBase64
Section titled “pngBase64”pngBase64: () =>
Promise<string>
Returns
Section titled “Returns”Promise<string>
events
Section titled “events”
readonlyevents:object
Defined in: Inspector.ts:459
clearLog
Section titled “clearLog”clearLog: () =>
void
Returns
Section titled “Returns”void
getLog
Section titled “getLog”getLog: () =>
EventLogEntry[]
Returns
Section titled “Returns”setCapacity
Section titled “setCapacity”setCapacity: (
n) =>void
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
waitFor
Section titled “waitFor”waitFor: (
pattern,options?) =>Promise<EventLogEntry>
Parameters
Section titled “Parameters”pattern
Section titled “pattern”string | RegExp
options?
Section titled “options?”source?
Section titled “source?”"entity" | "bus"
withinFrames?
Section titled “withinFrames?”number
Returns
Section titled “Returns”Promise<EventLogEntry>
readonlyinput:object
Defined in: Inspector.ts:369
clearAll
Section titled “clearAll”clearAll: () =>
void
Returns
Section titled “Returns”void
fireAction
Section titled “fireAction”fireAction: (
name,frames) =>void
Parameters
Section titled “Parameters”string
frames?
Section titled “frames?”number = 1
Returns
Section titled “Returns”void
gamepadAxis
Section titled “gamepadAxis”gamepadAxis: (
side,value) =>void
Parameters
Section titled “Parameters”InspectorGamepadAxisKey
number
Returns
Section titled “Returns”void
gamepadButton
Section titled “gamepadButton”gamepadButton: (
code,pressed) =>void
Parameters
Section titled “Parameters”string
pressed
Section titled “pressed”boolean
Returns
Section titled “Returns”void
hold: (
code,frames) =>void
Parameters
Section titled “Parameters”string
frames
Section titled “frames”number
Returns
Section titled “Returns”void
keyDown
Section titled “keyDown”keyDown: (
code) =>void
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
keyUp: (
code) =>void
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
mouseDown
Section titled “mouseDown”mouseDown: (
button) =>void
Parameters
Section titled “Parameters”button?
Section titled “button?”0 | 1 | 2
Returns
Section titled “Returns”void
mouseMove
Section titled “mouseMove”mouseMove: (
x,y) =>void
Parameters
Section titled “Parameters”number
number
Returns
Section titled “Returns”void
mouseUp
Section titled “mouseUp”mouseUp: (
button) =>void
Parameters
Section titled “Parameters”button?
Section titled “button?”0 | 1 | 2
Returns
Section titled “Returns”void
pointerDown
Section titled “pointerDown”pointerDown: (
button,opts?) =>void
Inject a synthetic pointer-down. With opts.id and opts.type: "touch"
this drives a multi-touch contact, exercising getPointers(),
per-pointer event hooks, and the any-pointer aggregate for MouseLeft.
Parameters
Section titled “Parameters”button?
Section titled “button?”0 | 1 | 2
InspectorPointerOpts
Returns
Section titled “Returns”void
pointerMove
Section titled “pointerMove”pointerMove: (
x,y,opts?) =>void
Inject a synthetic pointer-move with full pointer addressing. Pass opts
with id / type: "touch" to drive a specific finger; defaults match
the primary mouse pointer (same as mouseMove).
Parameters
Section titled “Parameters”number
number
InspectorPointerOpts
Returns
Section titled “Returns”void
pointerUp
Section titled “pointerUp”pointerUp: (
button,opts?) =>void
Parameters
Section titled “Parameters”button?
Section titled “button?”0 | 1 | 2
number
Returns
Section titled “Returns”void
tap: (
code,frames) =>void
Parameters
Section titled “Parameters”string
frames?
Section titled “frames?”number = 1
Returns
Section titled “Returns”void
readonlytime:object
Defined in: Inspector.ts:343
freeze
Section titled “freeze”freeze: () =>
void
Returns
Section titled “Returns”void
getFrame
Section titled “getFrame”getFrame: () =>
number
Returns
Section titled “Returns”number
isFrozen
Section titled “isFrozen”isFrozen: () =>
boolean
Returns
Section titled “Returns”boolean
setDelta
Section titled “setDelta”setDelta: (
ms) =>void
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
step: (
frames) =>void
Parameters
Section titled “Parameters”frames?
Section titled “frames?”number = 1
Returns
Section titled “Returns”void
thaw: () =>
void
Returns
Section titled “Returns”void
Methods
Section titled “Methods”addExtension()
Section titled “addExtension()”addExtension<
T>(namespace,api):T
Defined in: Inspector.ts:544
Register a namespaced extension API for plugin-specific debug helpers.
Type Parameters
Section titled “Type Parameters”T extends object
Parameters
Section titled “Parameters”namespace
Section titled “namespace”string
T
Returns
Section titled “Returns”T
attachSceneEventObserver()
Section titled “attachSceneEventObserver()”attachSceneEventObserver(
scene):void
Defined in: Inspector.ts:766
Internal
Install entity-event observation for one scene. No-op if disabled.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
attachTimeController()
Section titled “attachTimeController()”attachTimeController(
controller):void
Defined in: Inspector.ts:731
Internal
DebugPlugin attaches the frozen-time controller through this hook.
Parameters
Section titled “Parameters”controller
Section titled “controller”Returns
Section titled “Returns”void
createSceneRandom()
Section titled “createSceneRandom()”createSceneRandom():
RandomService
Defined in: Inspector.ts:697
Create a new scene-scoped RNG instance using the current inspector seed policy.
Returns
Section titled “Returns”detachSceneEventObserver()
Section titled “detachSceneEventObserver()”detachSceneEventObserver(
scene):void
Defined in: Inspector.ts:772
Internal
Clear entity-event observation for one scene.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
detachTimeController()
Section titled “detachTimeController()”detachTimeController(
controller?):void
Defined in: Inspector.ts:736
Internal
Clear a previously attached time controller.
Parameters
Section titled “Parameters”controller?
Section titled “controller?”Returns
Section titled “Returns”void
dispose()
Section titled “dispose()”dispose():
void
Defined in: Inspector.ts:793
Internal
Engine teardown releases the event-bus tap through this hook.
Returns
Section titled “Returns”void
getComponentData()
Section titled “getComponentData()”getComponentData(
entityName,componentClass):unknown
Defined in: Inspector.ts:635
Get component data (serializable subset) by class name string.
Parameters
Section titled “Parameters”entityName
Section titled “entityName”string
componentClass
Section titled “componentClass”string
Returns
Section titled “Returns”unknown
getEntities()
Section titled “getEntities()”getEntities():
EntitySnapshot[]
Defined in: Inspector.ts:646
Get all entities in the active scene as lightweight snapshots.
Returns
Section titled “Returns”getEntityByName()
Section titled “getEntityByName()”getEntityByName(
name):EntitySnapshot|undefined
Defined in: Inspector.ts:614
Find entity by name in the active scene.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”EntitySnapshot | undefined
getEntityPosition()
Section titled “getEntityPosition()”getEntityPosition(
name): {x:number;y:number; } |undefined
Defined in: Inspector.ts:621
Get entity position (from Transform component).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”{ x: number; y: number; } | undefined
getErrors()
Section titled “getErrors()”getErrors():
ErrorSnapshot
Defined in: Inspector.ts:680
Get disabled components/systems from error boundary.
Returns
Section titled “Returns”getExtension()
Section titled “getExtension()”getExtension<
T>(namespace):T|undefined
Defined in: Inspector.ts:562
Look up a previously registered extension API by namespace.
Type Parameters
Section titled “Type Parameters”T extends object
Parameters
Section titled “Parameters”namespace
Section titled “namespace”string
Returns
Section titled “Returns”T | undefined
getSceneStack()
Section titled “getSceneStack()”getSceneStack():
SceneSnapshot[]
Defined in: Inspector.ts:659
Get scene stack info.
Returns
Section titled “Returns”getSystems()
Section titled “getSystems()”getSystems():
SystemSnapshot[]
Defined in: Inspector.ts:668
Get active system info.
Returns
Section titled “Returns”hasComponent()
Section titled “hasComponent()”hasComponent(
entityName,componentClass):boolean
Defined in: Inspector.ts:630
Check if an entity has a component by class name string.
Parameters
Section titled “Parameters”entityName
Section titled “entityName”string
componentClass
Section titled “componentClass”string
Returns
Section titled “Returns”boolean
recordEntityEvent()
Section titled “recordEntityEvent()”recordEntityEvent(
eventName,data,entity):void
Defined in: Inspector.ts:777
Internal
Scene hooks forward entity events through this method.
Parameters
Section titled “Parameters”eventName
Section titled “eventName”string
unknown
entity
Section titled “entity”Returns
Section titled “Returns”void
removeExtension()
Section titled “removeExtension()”removeExtension(
namespace):void
Defined in: Inspector.ts:571
Remove a previously registered extension namespace.
Parameters
Section titled “Parameters”namespace
Section titled “namespace”string
Returns
Section titled “Returns”void
setDefaultSceneSeed()
Section titled “setDefaultSceneSeed()”setDefaultSceneSeed(
seed):void
Defined in: Inspector.ts:713
Internal
DebugPlugin installs a deterministic default seed through this hook.
Parameters
Section titled “Parameters”number | undefined
Returns
Section titled “Returns”void
setEventLogEnabled()
Section titled “setEventLogEnabled()”setEventLogEnabled(
enabled):void
Defined in: Inspector.ts:743
Internal
Enable or disable event log recording.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void
setSeed()
Section titled “setSeed()”setSeed(
seed):void
Defined in: Inspector.ts:704
Force every current and future scene RNG to the provided seed.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
snapshot()
Section titled “snapshot()”snapshot():
EngineSnapshot
Defined in: Inspector.ts:580
Full deterministic state snapshot (stable ordering, serializable).
Returns
Section titled “Returns”snapshotJSON()
Section titled “snapshotJSON()”snapshotJSON():
string
Defined in: Inspector.ts:598
Stable JSON form of snapshot.
Returns
Section titled “Returns”string
snapshotScene()
Section titled “snapshotScene()”snapshotScene(
id):WorldSceneSnapshot
Defined in: Inspector.ts:603
Snapshot one scene by inspector scene id.
Parameters
Section titled “Parameters”string