Scene
Find entities by name, ID, tag, layer, or attached component.
Open referenceKriya documentation
Learn the runtime model, author TypeScript gameplay, connect an AI agent through MCP, and ship the same project across platforms.
Editor introduction
The center canvas stays visible while project structure and editable data remain on either side.
Choose a workspace to see its real editor surface and the job it handles.
Reference material, shortcuts, and the export pipeline stay inside the editor.
The groups below cover the visible authoring and delivery surfaces in Kriya 0.5.5.
Inspector components are cataloged separately under Engine components. MCP setup and agent capabilities are covered under MCP and AI agents.
Quick start
import { Debug, Input, Script, property } from "@engine/runtime";
export default class PlayerController extends Script {
@property({ type: "number", min: 0, step: 10 })
moveSpeed = 250;
start() {
Debug.log(`${this.entity.name} started`);
}
update(delta: number) {
const direction = Input.getAxis("MoveLeft", "MoveRight");
const velocity = this.entity.getVelocity();
this.entity.setVelocity(direction * this.moveSpeed, velocity.y);
void delta;
}
}Use @engine/runtime for public engine APIs. Relative imports between project scripts are supported; editor modules are not.
Scripting lifecycle
onCollisionEnter, Stay, and Exit receive non-trigger contacts. Trigger variants receive overlaps.
this.timer and this.events clean up script-owned timers and listeners automatically on destruction.
Inspector properties
@property() decorator turns script fields into serialized Inspector controls with labels, ranges, steps, and options. @property({ type: "number", label: "Move Speed", min: 0, step: 10 })
moveSpeed = 250;
@property({ type: "boolean", label: "Can Double Jump" })
canDoubleJump = true;
@property({ type: "enum", label: "Movement", options: ["Walk", "Run"] })
movement = "Walk";Supported metadata includes numbers, strings, booleans, vectors, colors, enums, entities, prefabs, and asset references.
Runtime systems
Find entities by name, ID, tag, layer, or attached component.
Open referenceRead named actions, pointer state, touch controls, and gamepads.
Open referenceRaycast, shape cast, and overlap against the Matter.js world.
Open referenceSchedule scaled or unscaled callbacks with automatic script cleanup.
Open referencePublish typed global signals or listen through an entity-local event bus.
Open referenceFind deterministic A* paths across collision-enabled Tilemap layers.
Open referencePersist JSON-serializable progress, settings, checkpoints, and scores.
Open referenceStart, advance, branch, and end authored DialogueBox conversations.
Open referenceimport { LayerMask, Physics2D, Scene, Script } from "@engine/runtime";
export default class EnemySensor extends Script {
start() {
const player = Scene.findByTag("Player");
if (!player) return;
const hit = Physics2D.raycast(
this.transform.position,
{ x: 1, y: 0 },
{ distance: 240, layerMask: LayerMask.from("Player") },
);
if (hit?.entity.id === player.id) this.entity.playAnimation("Attack");
}
}Engine components
Use getComponent(), getComponents(), hasComponent(), addComponent(), and removeComponent(). Transform cannot be removed.
MCP and AI agents
Agents can read before changing, compile TypeScript with diagnostics, update the active project, and invoke Kriya's export pipeline.
kriya://project kriya://scripting-api Generated API reference
160 top-level symbols
Creates or joins host-authoritative WebRTC rooms and exchanges JSON messages with connected peers. The runtime supplies the active implementation to user scripts.
NetworkApi src/runtime/scripting/publicApi.ts:150 Network.host(options?: NetworkHostOptions): Promise<string> Network.host runtime operation.
Network.isHost: boolean Network.isHost runtime value.
Network.join(roomCode: string, options?: NetworkJoinOptions): Promise<void> Network.join runtime operation.
Network.leave(reason?: string): void Network.leave runtime operation.
Network.localPeerId: string | null Network.localPeerId runtime value.
Network.off<K extends NetworkEventName>(event: K, listener: NetworkListener<K>): void Network.off runtime operation.
Network.on<K extends NetworkEventName>(event: K, listener: NetworkListener<K>): () => void Network.on runtime operation.
Network.peers: readonly NetworkPeer[] Network.peers runtime value.
Network.role: NetworkRole Network.role runtime value.
Network.roomCode: string | null Network.roomCode runtime value.
Network.send(type: string, data?: NetworkPayload, options?: NetworkSendOptions): void Network.send runtime operation.
Network.status: NetworkStatus Network.status runtime value.
NetworkApi scripting API.
interface NetworkApi src/runtime/network/Network.ts:62 NetworkApi.host(options?: NetworkHostOptions): Promise<string> NetworkApi.host runtime operation.
NetworkApi.isHost: boolean NetworkApi.isHost runtime value.
NetworkApi.join(roomCode: string, options?: NetworkJoinOptions): Promise<void> NetworkApi.join runtime operation.
NetworkApi.leave(reason?: string): void NetworkApi.leave runtime operation.
NetworkApi.localPeerId: string | null NetworkApi.localPeerId runtime value.
NetworkApi.off<K extends NetworkEventName>(event: K, listener: NetworkListener<K>): void NetworkApi.off runtime operation.
NetworkApi.on<K extends NetworkEventName>(event: K, listener: NetworkListener<K>): () => void NetworkApi.on runtime operation.
NetworkApi.peers: readonly NetworkPeer[] NetworkApi.peers runtime value.
NetworkApi.role: NetworkRole NetworkApi.role runtime value.
NetworkApi.roomCode: string | null NetworkApi.roomCode runtime value.
NetworkApi.send(type: string, data?: NetworkPayload, options?: NetworkSendOptions): void NetworkApi.send runtime operation.
NetworkApi.status: NetworkStatus NetworkApi.status runtime value.
NetworkData scripting API.
type NetworkData src/runtime/network/Network.ts:4 NetworkEventMap scripting API.
interface NetworkEventMap src/runtime/network/Network.ts:50 NetworkEventMap.close: { reason: string; } NetworkEventMap.close runtime value.
NetworkEventMap.error: { message: string; } NetworkEventMap.error runtime value.
NetworkEventMap.message: NetworkMessage<NetworkPayload> NetworkEventMap.message runtime value.
NetworkEventMap.open: { role: Exclude<NetworkRole, "none">; roomCode: string; peerId: string; } NetworkEventMap.open runtime value.
NetworkEventMap.peer-joined: NetworkPeer NetworkEventMap.peer-joined runtime value.
NetworkEventMap.peer-left: { peerId: string; } NetworkEventMap.peer-left runtime value.
NetworkHostOptions scripting API.
interface NetworkHostOptions src/runtime/network/Network.ts:19 NetworkHostOptions.iceServers: RTCIceServer[] | undefined ICE servers used by WebRTC. Supply a TURN server for reliable internet connectivity.
NetworkHostOptions.maxPlayers: number | undefined Total participants including the host.
NetworkHostOptions.roomCode: string | undefined Optional code to request. The signaling service may replace it when unavailable.
NetworkHostOptions.signalingUrl: string | undefined WebSocket endpoint of a Kriya-compatible signaling service. Defaults to /multiplayer on the current host.
NetworkJoinOptions scripting API.
interface NetworkJoinOptions src/runtime/network/Network.ts:30 NetworkJoinOptions.iceServers: RTCIceServer[] | undefined NetworkJoinOptions.iceServers runtime value.
NetworkJoinOptions.signalingUrl: string | undefined NetworkJoinOptions.signalingUrl runtime value.
NetworkMessage scripting API.
interface NetworkMessage src/runtime/network/Network.ts:42 NetworkMessage.data: T An ArrayBuffer when the sender sent bytes, otherwise the JSON value it sent.
NetworkMessage.peerId: string NetworkMessage.peerId runtime value.
NetworkMessage.reliable: boolean NetworkMessage.reliable runtime value.
NetworkMessage.type: string NetworkMessage.type runtime value.
NetworkPeer scripting API.
interface NetworkPeer src/runtime/network/Network.ts:14 NetworkPeer.connected: boolean NetworkPeer.connected runtime value.
NetworkPeer.id: string NetworkPeer.id runtime value.
NetworkRole scripting API.
type NetworkRole src/runtime/network/Network.ts:1 NetworkSendOptions scripting API.
interface NetworkSendOptions src/runtime/network/Network.ts:35 NetworkSendOptions.reliable: boolean | undefined Reliable ordered delivery for commands and important state. Defaults to false for fresh realtime data.
NetworkSendOptions.target: string | undefined Host only: send to one peer. Omit to broadcast. Clients always send to the host.
NetworkStatus scripting API.
type NetworkStatus src/runtime/network/Network.ts:2 Native mobile advertising. Call initialize before showing ads; test ads are the default.
{ readonly available: boolean; initialize(options?: AdsInitializationOptions): Promise<boolean>; showBanner(adUnitId: string, position?: "top" | "bottom"): Promise<void>; removeBanner(): Promise<void>; prepareInterstitial(adUnitId: string): Promise<void>; showInterstitial(): Promise<void>; prepareRewarded(adUnitId: string): Promise<void>; showRewarded(): Promise<{ amount: number; type: string; }>; showPrivacyOptions(): Promise<void>; setUnityPrivacy(choices: UnityAdsPrivacy): Promise<void>; } src/runtime/ads/Ads.ts:5 Ads.available: boolean False in the editor, browser, or a build without the native AdMob plugin.
Ads.initialize(options?: AdsInitializationOptions): Promise<boolean> Updates consent and presents the consent form when required. Returns whether ads may load.
Ads.prepareInterstitial(adUnitId: string): Promise<void> Loads a full-screen ad ahead of a natural break in gameplay.
Ads.prepareRewarded(adUnitId: string): Promise<void> Loads a rewarded video before offering it to the player.
Ads.removeBanner(): Promise<void> Destroys the banner and removes its overlay.
Ads.setUnityPrivacy(choices: UnityAdsPrivacy): Promise<void> Forwards player privacy choices to Unity Ads. Call before initialization or after choices change.
Ads.showBanner(adUnitId: string, position?: "top" | "bottom"): Promise<void> Shows an adaptive banner. Reserve room in your game UI for this native overlay.
Ads.showInterstitial(): Promise<void> Presents the previously prepared interstitial.
Ads.showPrivacyOptions(): Promise<void> Opens the player's privacy choices and invalidates permission until initialize is called again.
Ads.showRewarded(): Promise<{ amount: number; type: string; }> Resolves with the SDK reward only when earned; failure rejects.
AdsInitializationOptions scripting API.
interface AdsInitializationOptions src/runtime/ads/Ads.ts:68 AdsInitializationOptions.testingDevices: string[] | undefined AdMob test device IDs for testing your own mediation configuration with testMode false.
AdsInitializationOptions.testMode: boolean | undefined Uses Google demo ads by default. Set false to request your own mediated ad units.
AdsInitializationOptions.unityPrivacy: UnityAdsPrivacy | undefined Actual player choices, forwarded before the Google Ads SDK initializes mediation.
Positions and sizes an entity in screen pixels relative to its nearest UICanvas or Anchor ancestor.
"Anchor" src/runtime/index.ts:188 The nine screen-relative anchor points, or "stretch" to fill the parent rect inset by offset.
type AnchorPoint src/shared/types/components.ts:189 Applies a named or custom curve. Progress is clamped so that every curve starts at exactly 0 and ends at exactly 1, which keeps overshooting curves from leaving a tween off its target value.
applyEasing(easing: EasingName | EasingFunction | undefined, progress: number): number src/shared/utils/easing.ts:52 AssetData scripting API.
interface AssetData src/shared/types/assets.ts:47 AssetData.animationClipId: string | undefined Links an editor-visible `.anim` asset to ProjectData.animations.
AssetData.animatorControllerId: string | undefined Links an editor-visible controller asset to ProjectData.animatorControllers.
AssetData.compiledSource: string | undefined AssetData.compiledSource runtime value.
AssetData.diagnostics: string[] | undefined AssetData.diagnostics runtime value.
AssetData.folderId: string | null | undefined Virtual Asset Browser folder. Null or omitted places the asset at the project root.
AssetData.height: number | undefined AssetData.height runtime value.
AssetData.id: string AssetData.id runtime value.
AssetData.mimeType: string AssetData.mimeType runtime value.
AssetData.missing: boolean | undefined Editor-only status set when sourcePath cannot be read.
AssetData.name: string AssetData.name runtime value.
AssetData.physicsMaterial: PhysicsMaterial2D | undefined AssetData.physicsMaterial runtime value.
AssetData.scriptProperties: ScriptPropertyMetadata[] | undefined AssetData.scriptProperties runtime value.
AssetData.size: number AssetData.size runtime value.
AssetData.sourceChanged: boolean | undefined Editor-only status set when the external source differs from the last saved project metadata.
AssetData.sourceMap: ScriptSourceMap | undefined AssetData.sourceMap runtime value.
AssetData.sourceModifiedAt: number | undefined Last filesystem modification time observed when the external source was saved or loaded.
AssetData.sourcePath: string | undefined Project-relative source file used by desktop projects. Browser projects keep using inline src data.
AssetData.sourceText: string | undefined AssetData.sourceText runtime value.
AssetData.spriteFrame: SpriteFrameData | undefined AssetData.spriteFrame runtime value.
AssetData.spriteImport: SpriteImportSettings | undefined AssetData.spriteImport runtime value.
AssetData.src: string Resolved data URL while the project is open; omitted from desktop project files for external assets.
AssetData.type: AssetType AssetData.type runtime value.
AssetData.width: number | undefined AssetData.width runtime value.
Bounds2D scripting API.
interface Bounds2D src/runtime/scripting/Collider2D.ts:5 Bounds2D.center: Vector2 Bounds2D.center runtime value.
Bounds2D.max: Vector2 Bounds2D.max runtime value.
Bounds2D.min: Vector2 Bounds2D.min runtime value.
Bounds2D.size: Vector2 Bounds2D.size runtime value.
Detailed non-trigger collision callback data. Extends the other collider for backward compatibility.
class CollisionEvent2D src/runtime/scripting/PhysicsEvents2D.ts:8 CollisionEvent2D.component: Collider2DComponent CollisionEvent2D.component runtime value.
CollisionEvent2D.contacts: ContactPoint2D[] CollisionEvent2D.contacts runtime value.
CollisionEvent2D.containsPoint(point: Vector2Like): boolean Tests a world-space point against this collider's exact engine shape.
CollisionEvent2D.enabled: boolean CollisionEvent2D.enabled runtime value.
CollisionEvent2D.entity: RuntimeEntity CollisionEvent2D.entity runtime value.
CollisionEvent2D.getBounds(): Bounds2D Returns a world-axis-aligned bounding box.
CollisionEvent2D.getClosestPoint(point: Vector2Like): Vector2 Returns the closest point on or inside the collider in world space.
CollisionEvent2D.id: string CollisionEvent2D.id runtime value.
CollisionEvent2D.isTrigger: boolean CollisionEvent2D.isTrigger runtime value.
CollisionEvent2D.layer: string Collider filtering uses its owning entity's project layer.
CollisionEvent2D.material: PhysicsMaterial2D | null Physics material asset ID. Material assets are introduced in Collider Phase 2.
CollisionEvent2D.name: string CollisionEvent2D.name runtime value.
CollisionEvent2D.normal: Vector2 CollisionEvent2D.normal runtime value.
CollisionEvent2D.offset: Vector2 CollisionEvent2D.offset runtime value.
CollisionEvent2D.oneWay: boolean CollisionEvent2D.oneWay runtime value.
CollisionEvent2D.oneWayDirection: Vector2 Local direction of the solid face for one-way collision handling.
CollisionEvent2D.oneWayTolerance: number Positional tolerance in world units used near a one-way surface.
CollisionEvent2D.otherCollider: Collider2D CollisionEvent2D.otherCollider runtime value.
CollisionEvent2D.otherEntity: RuntimeEntity CollisionEvent2D.otherEntity runtime value.
CollisionEvent2D.relativeVelocity: Vector2 CollisionEvent2D.relativeVelocity runtime value.
CollisionEvent2D.selfCollider: Collider2D CollisionEvent2D.selfCollider runtime value.
ComponentConstructor scripting API.
type ComponentConstructor src/runtime/scene/SceneQuery.ts:6 ComponentConstructor.name: string ComponentConstructor.name runtime value.
ComponentQuery scripting API.
type ComponentQuery src/runtime/scene/SceneQuery.ts:7 One contact generated by a non-trigger collision.
interface ContactPoint2D src/runtime/scripting/PhysicsEvents2D.ts:5 ContactPoint2D.normal: Vector2 ContactPoint2D.normal runtime value.
ContactPoint2D.point: Vector2 ContactPoint2D.point runtime value.
ContactPoint2D.separation: number ContactPoint2D.separation runtime value.
Plays authored cutscenes: start one by name, stop it, skip to the end, or ask what is running. The runtime supplies the active implementation to user scripts.
CutsceneApi src/runtime/scripting/publicApi.ts:93 Cutscene.current(): string | null Name of the running cutscene, or null.
Cutscene.isPlaying(nameOrId?: string): boolean True while any cutscene runs, or while the named one runs.
Cutscene.play(nameOrId: string): void Starts a cutscene by name or ID, replacing any cutscene already running.
Cutscene.skip(): void Jumps to the end, applies the final frame of every track, and ends playback.
Cutscene.stop(): void Ends the running cutscene where it stands, leaving applied values in place.
Cutscene.time(): number Current playback position in seconds, or 0 when nothing is running.
Script-facing control over authored cutscenes.
interface CutsceneApi src/runtime/cutscene/CutsceneSystem.ts:24 CutsceneApi.current(): string | null Name of the running cutscene, or null.
CutsceneApi.isPlaying(nameOrId?: string): boolean True while any cutscene runs, or while the named one runs.
CutsceneApi.play(nameOrId: string): void Starts a cutscene by name or ID, replacing any cutscene already running.
CutsceneApi.skip(): void Jumps to the end, applies the final frame of every track, and ends playback.
CutsceneApi.stop(): void Ends the running cutscene where it stands, leaving applied values in place.
CutsceneApi.time(): number Current playback position in seconds, or 0 when nothing is running.
Payload delivered with every `cutscene:*` event on the global bus.
interface CutsceneEvent src/shared/types/cutscene.ts:69 CutsceneEvent.cutsceneId: string CutsceneEvent.cutsceneId runtime value.
CutsceneEvent.name: string CutsceneEvent.name runtime value.
CutsceneEvent.time: number Cutscene time in seconds when the event was emitted.
Payload delivered with `cutscene:marker` when playback crosses an event track marker.
interface CutsceneMarkerEvent src/shared/types/cutscene.ts:77 CutsceneMarkerEvent.booleanValue: boolean | undefined CutsceneMarkerEvent.booleanValue runtime value.
CutsceneMarkerEvent.cutsceneId: string CutsceneMarkerEvent.cutsceneId runtime value.
CutsceneMarkerEvent.marker: string Authored marker name.
CutsceneMarkerEvent.name: string CutsceneMarkerEvent.name runtime value.
CutsceneMarkerEvent.numberValue: number | undefined CutsceneMarkerEvent.numberValue runtime value.
CutsceneMarkerEvent.stringValue: string | undefined CutsceneMarkerEvent.stringValue runtime value.
CutsceneMarkerEvent.targetEntityId: string | null Entity the marker's track targets, when it has one.
CutsceneMarkerEvent.time: number Cutscene time in seconds when the event was emitted.
Writes messages to the game console and the editor Console during Play Mode.
class Debug src/runtime/scripting/Debug.ts:10 Destroys an entity. With no argument, a script destroys its own entity.
destroy(target?: RuntimeEntity): void src/runtime/scripting/publicApi.ts:176 Drives DialogueBox entities: start/advance a conversation, pick a choice, or end it early. The runtime supplies the active implementation to user scripts.
DialogueApi src/runtime/scripting/publicApi.ts:73 Dialogue.advance(entityId: string): void Advances past the current line. No-op while the line has choices — pick one with choose() instead.
Dialogue.choose(entityId: string, choiceId: string): void Dialogue.choose runtime operation.
Dialogue.currentLineId(entityId: string): string | null Dialogue.currentLineId runtime operation.
Dialogue.end(entityId: string): void Ends the conversation early, destroying any spawned choice buttons and disabling the subtree.
Dialogue.isActive(entityId: string): boolean Dialogue.isActive runtime operation.
Dialogue.start(entityId: string): void Enables the DialogueBox entity's whole subtree and jumps to its startLineId.
Public shape of the Dialogue API exposed to scripts.
interface DialogueApi src/runtime/dialogue/DialogueSystem.ts:48 DialogueApi.advance(entityId: string): void Advances past the current line. No-op while the line has choices — pick one with choose() instead.
DialogueApi.choose(entityId: string, choiceId: string): void DialogueApi.choose runtime operation.
DialogueApi.currentLineId(entityId: string): string | null DialogueApi.currentLineId runtime operation.
DialogueApi.end(entityId: string): void Ends the conversation early, destroying any spawned choice buttons and disabling the subtree.
DialogueApi.isActive(entityId: string): boolean DialogueApi.isActive runtime operation.
DialogueApi.start(entityId: string): void Enables the DialogueBox entity's whole subtree and jumps to its startLineId.
A linear conversation with optional branching choices, driven by the runtime DialogueSystem.
"DialogueBox" src/runtime/index.ts:196 One clickable option shown when a DialogueLine has choices instead of a plain continue.
interface DialogueChoice src/shared/types/components.ts:432 DialogueChoice.id: string DialogueChoice.id runtime value.
DialogueChoice.nextLineId: string | null Line to jump to when this choice is picked. Null ends the conversation.
DialogueChoice.text: string DialogueChoice.text runtime value.
Payload delivered with "dialogue:choice" when a player picks a branch.
interface DialogueChoiceEvent src/runtime/dialogue/DialogueSystem.ts:25 DialogueChoiceEvent.choiceId: string DialogueChoiceEvent.choiceId runtime value.
DialogueChoiceEvent.choiceText: string DialogueChoiceEvent.choiceText runtime value.
DialogueChoiceEvent.entityId: string DialogueBox entity driving the conversation. Pass it back to Dialogue.advance or Dialogue.end.
DialogueChoiceEvent.lineId: string DialogueChoiceEvent.lineId runtime value.
DialogueChoiceEvent.nextLineId: string | null Line the conversation jumps to, or null when the choice ends it.
DialogueChoiceEvent.speaker: string DialogueChoiceEvent.speaker runtime value.
DialogueChoiceEvent.text: string DialogueChoiceEvent.text runtime value.
Payload delivered with every dialogue signal on the global Events bus.
interface DialogueEvent src/runtime/dialogue/DialogueSystem.ts:16 DialogueEvent.entityId: string DialogueBox entity driving the conversation. Pass it back to Dialogue.advance or Dialogue.end.
DialogueEvent.lineId: string DialogueEvent.lineId runtime value.
DialogueEvent.speaker: string DialogueEvent.speaker runtime value.
DialogueEvent.text: string DialogueEvent.text runtime value.
One page of dialogue: who's speaking, the line's text, and how the player moves past it.
interface DialogueLine src/shared/types/components.ts:440 DialogueLine.choices: DialogueChoice[] Empty means clicking/continuing advances straight to nextLineId instead of showing choice buttons.
DialogueLine.id: string DialogueLine.id runtime value.
DialogueLine.nextLineId: string | null Used only when choices is empty. Null ends the conversation.
DialogueLine.speaker: string Empty string hides the speaker label for this line.
DialogueLine.text: string DialogueLine.text runtime value.
Curve implementations keyed by name. `back-out` and `bounce-out` deliberately overshoot mid-curve.
Record<EasingName, EasingFunction> src/shared/utils/easing.ts:36 EASING_NAMES scripting API.
EasingName[] src/shared/utils/easing.ts:46 Custom curve accepted anywhere a named easing is. Receives and returns normalized progress.
EasingFunction(progress: number): number src/shared/utils/easing.ts:15 Named easing curves shared by UI interaction transitions, runtime tweens, and cutscene sequencing. Every curve maps a normalized 0..1 progress onto an eased 0..1 value.
type EasingName src/shared/utils/easing.ts:5 EngineComponent scripting API.
type EngineComponent src/shared/types/components.ts:729 EngineComponent.enabled: boolean EngineComponent.enabled runtime value.
EngineComponent.type: "Transform" | "SpriteRenderer" | "TextRenderer" | "Camera2D" | "Rigidbody2D" | "Joint2D" | "BoxCollider2D" | "CircleCollider2D" | "CapsuleCollider2D" | "PolygonCollider2D" | "EdgeCollider2D" | "CompositeCollider2D" | "TilemapCollider2D" | "Animator" | "AudioSource" | "Script" | "Tilemap" | "ParticleEmitter" | "ParallaxLayer" | "Light2D" | "UICanvas" | "Anchor" | "UIButton" | "UIToggle" | "UISlider" | "UIHoverAnimation" | "UIPanel" | "UIScrollView" | "UIInputField" | "DialogueBox" | "Interactable" EngineComponent.type runtime value.
Represents an object inside the active runtime scene.
class Entity src/runtime/core/RuntimeEntity.ts:34 Entity.active: boolean Alias for {@link enabled}.
Entity.addChild(child: RuntimeEntity): void Entity.addChild runtime operation.
Entity.addComponent(component: EngineComponent): void Adds a component and refreshes runtime systems. Script components may be added more than once.
Entity.addTag(tag: string): void Adds a unique serializable tag.
Entity.children: RuntimeEntity[] Direct child entities in serialized hierarchy order.
Entity.clone(): RuntimeEntity Clones this entity hierarchy into the active scene.
Entity.destroy(): void Destroys this entity and all of its children.
Entity.enabled: boolean Whether the entity is enabled in its scene.
Entity.events: OwnedEvents<EntityEvents> Local signal bus. Script listeners are automatically removed on destruction.
Entity.exists: boolean Whether this runtime entity still exists in the active scene.
Entity.fadeInAudio(duration: number): void Starts (or resumes) this entity's AudioSource at zero volume and ramps up to its configured volume over `duration` seconds.
Entity.fadeOutAudio(duration: number): void Ramps this entity's AudioSource volume down to zero over `duration` seconds, then stops it.
Entity.getComponent(type: "Animator"): RuntimeAnimator | undefined Returns the first component of the requested type.
Entity.getComponents<T extends ComponentType>(type: T): Extract<EngineComponent, { type: T; }>[] Returns every matching component; omit type to return all components.
Entity.getVelocity(): SharedVector2 Returns the current Matter.js body velocity.
Entity.hasComponent(type: ComponentType): boolean Returns whether an engine component is attached.
Entity.hasTag(tag: string): boolean Tests whether this entity contains a tag.
Entity.id: string Entity.id runtime value.
Entity.instantiate(template: EntityData | PrefabData, positionOrOptions?: Vector2Like | InstantiateOptions): RuntimeEntity Creates an independent runtime copy of entity data or a complete prefab hierarchy.
Entity.isAudioPlaying(): boolean Whether this entity's AudioSource component is currently playing.
Entity.layer: string Named gameplay/physics layer.
Entity.name: string Display name serialized with the entity.
Entity.parent: RuntimeEntity | null Parent entity, or null for a scene root.
Entity.playAnimation(clipNameOrId: string): void Starts an Animator clip by its name or ID without restarting an already-playing clip.
Entity.playAudio(): void Starts this entity's enabled AudioSource component.
Entity.removeChild(child: RuntimeEntity): void Entity.removeChild runtime operation.
Entity.removeComponent(type: ComponentType, componentId?: string): void Removes components by type. Pass a script component ID to remove only that script instance.
Entity.removeTag(tag: string): void Removes a tag when present.
Entity.setActive(active: boolean): void Enables or disables this entity.
Entity.setParent(parent: RuntimeEntity | null): void Reparents this entity while preserving its local transform values.
Entity.setText(value: string): void Changes the first TextRenderer attached to this entity.
Entity.setVelocity(x: number, y: number): void Sets the Matter.js body velocity.
Entity.stopAnimation(): void Stops the animation currently playing on this entity.
Entity.stopAudio(): void Stops and rewinds this entity's AudioSource component.
Entity.tags: readonly string[] Serializable gameplay tags attached to the entity.
Entity.teleport(x: number, y: number): void Moves this entity immediately while keeping its physics body synchronized.
Entity.transform: RuntimeTransform Transform attached to this entity.
EntityData scripting API.
interface EntityData src/shared/types/scene.ts:3 EntityData.children: string[] EntityData.children runtime value.
EntityData.components: EngineComponent[] EntityData.components runtime value.
EntityData.enabled: boolean EntityData.enabled runtime value.
EntityData.id: string EntityData.id runtime value.
EntityData.layer: string | undefined Physics, rendering, and query layer. Defaults to `Default`.
EntityData.name: string EntityData.name runtime value.
EntityData.parentId: string | null EntityData.parentId runtime value.
EntityData.prefab: { prefabId: string; sourceEntityId: string; } | undefined EntityData.prefab runtime value.
EntityData.tags: string[] | undefined Gameplay classification. An entity may have any number of tags.
Small signal bus used by global Events and per-entity signals.
class EventBus src/runtime/events/Events.ts:10 EventBus.clear(): void EventBus.clear runtime operation.
EventBus.emit<K extends EventName<TEvents>>(name: K, ...args: EventArgs<TEvents, K>): void EventBus.emit runtime operation.
EventBus.off<K extends EventName<TEvents>>(name: K, callback: Listener<TEvents[K]>): void EventBus.off runtime operation.
EventBus.on<K extends EventName<TEvents>>(name: K, callback: Listener<TEvents[K]>, ownerId?: string): () => void EventBus.on runtime operation.
EventBus.removeOwner(ownerId: string): void EventBus.removeOwner runtime operation.
Public global signal placeholder replaced by the active runtime bus in user modules.
EventsApi src/runtime/events/Events.ts:75 Events.emit<K>(name: K, ...args: EventArgs<GameEvents, K>): void Invokes current listeners with an optional payload.
Events.off<K>(name: K, callback: Listener<GameEvents[K]>): void Removes matching listener registrations.
Events.on<K>(name: K, callback: Listener<GameEvents[K]>): () => void Registers a listener and returns an unsubscribe callback. Script-owned listeners are cleaned up automatically.
EventsApi scripting API.
type EventsApi src/runtime/events/Events.ts:59 EventsApi.emit<K>(name: K, ...args: EventArgs<GameEvents, K>): void Invokes current listeners with an optional payload.
EventsApi.off<K>(name: K, callback: Listener<GameEvents[K]>): void Removes matching listener registrations.
EventsApi.on<K>(name: K, callback: Listener<GameEvents[K]>): () => void Registers a listener and returns an unsubscribe callback. Script-owned listeners are cleaned up automatically.
Game scripting API.
class Game src/runtime/Game.ts:10 Game.loadProject(source: string | ProjectData): Promise<void> Game.loadProject runtime operation.
Game.loadScene(nameOrId: string): Promise<void> Game.loadScene runtime operation.
Game.options: GameOptions Game.options runtime value.
Game.start(inputTarget?: HTMLElement): Promise<GameRuntime> Game.start runtime operation.
Game.stop(): void Game.stop runtime operation.
Extend this interface through module augmentation to type global game events.
interface GameEvents src/runtime/events/Events.ts:2 GameEvents.cutscene:end: CutsceneEvent A cutscene finished, was stopped, or was skipped.
GameEvents.cutscene:marker: CutsceneMarkerEvent Playback crossed an event track marker.
GameEvents.cutscene:start: CutsceneEvent A cutscene began, before its first frame is applied.
GameEvents.dialogue:choice: DialogueChoiceEvent A choice was picked, before the conversation moves on.
GameEvents.dialogue:end: DialogueEvent The conversation ended, carrying the last line it showed.
GameEvents.dialogue:line: DialogueEvent A line became current. Its text may still be typing in.
GameEvents.dialogue:revealed: DialogueEvent A line finished revealing every character.
GameEvents.dialogue:start: DialogueEvent A conversation began, before its first line is entered.
GameEvents.interaction:trigger: InteractionEvent Emitted after an Interactable target receives an interaction.
GameRuntime scripting API.
class GameRuntime src/runtime/GameRuntime.ts:48 GameRuntime.dispatchUIEvent(entityId: string, type: "click" | "pointerenter" | "pointerexit" | "focus" | "blur" | "change" | "submit"): void Forwards a Button/Toggle/Slider interaction from the renderer to scripts and any active dialogue choice buttons.
GameRuntime.getScene(): SceneData GameRuntime.getScene runtime operation.
GameRuntime.getStartSceneName(): string Name of the scene the project starts with, ignoring any loading scene booted ahead of it.
GameRuntime.loadScene(nameOrId: string): void GameRuntime.loadScene runtime operation.
GameRuntime.loadSceneAsync(nameOrId: string): SceneLoadOperation Warms the target scene's assets through the shell, then queues the swap, so a loading screen can report real progress. Falls back to a plain swap when the shell warms nothing.
GameRuntime.pause(): void GameRuntime.pause runtime operation.
GameRuntime.resume(): void GameRuntime.resume runtime operation.
GameRuntime.setTouchControlsPreview(visible: boolean): void Force-shows or hides the on-screen touch controls, for editors previewing mobile layout on a desktop pointer.
GameRuntime.start(inputTarget: HTMLElement): Promise<void> Loads persisted save data, then boots the first scene. Await this before assuming Save.get returns saved values.
GameRuntime.stop(): void GameRuntime.stop runtime operation.
GridCell scripting API.
interface GridCell src/engine/navigation/GridPathfinding.ts:1 GridCell.x: number GridCell.x runtime value.
GridCell.y: number GridCell.y runtime value.
Creates a runtime entity or prefab hierarchy with optional transform and parent overrides.
instantiate(template: EntityData | PrefabData, position?: Vector2 | InstantiateOptions): RuntimeEntity src/runtime/scripting/publicApi.ts:169 InstantiateOptions scripting API.
interface InstantiateOptions src/runtime/core/RuntimeEntity.ts:10 InstantiateOptions.parent: RuntimeEntity | null | undefined InstantiateOptions.parent runtime value.
InstantiateOptions.position: Vector2Like | undefined InstantiateOptions.position runtime value.
InstantiateOptions.rotation: number | undefined InstantiateOptions.rotation runtime value.
Marks a world entity as discoverable through the Interaction API. Component token for entities discoverable by Interaction.findNearest.
"Interactable" src/runtime/index.ts:198 Finds and triggers enabled Interactable entities in the active runtime scene.
InteractionApi src/runtime/scripting/publicApi.ts:83 Interaction.findNearest(interactor: RuntimeEntity, options?: InteractionQueryOptions): InteractionTarget | null Finds the best enabled target: highest priority first, then shortest world-space distance.
Interaction.trigger(target: RuntimeEntity | string, interactor: RuntimeEntity): boolean Emits an interaction directly on one target. Returns false when it is not interactable.
Interaction.tryInteract(interactor: RuntimeEntity, options?: InteractionQueryOptions): InteractionTarget | null Finds the best target and triggers it in one call.
InteractionApi scripting API.
interface InteractionApi src/runtime/interaction/InteractionSystem.ts:40 InteractionApi.findNearest(interactor: RuntimeEntity, options?: InteractionQueryOptions): InteractionTarget | null Finds the best enabled target: highest priority first, then shortest world-space distance.
InteractionApi.trigger(target: RuntimeEntity | string, interactor: RuntimeEntity): boolean Emits an interaction directly on one target. Returns false when it is not interactable.
InteractionApi.tryInteract(interactor: RuntimeEntity, options?: InteractionQueryOptions): InteractionTarget | null Finds the best target and triggers it in one call.
InteractionEvent scripting API.
interface InteractionEvent src/runtime/interaction/InteractionSystem.ts:20 InteractionEvent.action: string InteractionEvent.action runtime value.
InteractionEvent.distance: number InteractionEvent.distance runtime value.
InteractionEvent.interactor: RuntimeEntity InteractionEvent.interactor runtime value.
InteractionEvent.priority: number InteractionEvent.priority runtime value.
InteractionEvent.prompt: string InteractionEvent.prompt runtime value.
InteractionEvent.target: RuntimeEntity InteractionEvent.target runtime value.
InteractionQueryOptions scripting API.
interface InteractionQueryOptions src/runtime/interaction/InteractionSystem.ts:5 InteractionQueryOptions.action: string | undefined Only consider Interactable components with this semantic action.
InteractionQueryOptions.maxDistance: number | undefined Additional caller-side range cap. The target's own interactionDistance still applies.
InteractionTarget scripting API.
interface InteractionTarget src/runtime/interaction/InteractionSystem.ts:12 InteractionTarget.action: string InteractionTarget.action runtime value.
InteractionTarget.distance: number InteractionTarget.distance runtime value.
InteractionTarget.entity: RuntimeEntity InteractionTarget.entity runtime value.
InteractionTarget.priority: number InteractionTarget.priority runtime value.
InteractionTarget.prompt: string InteractionTarget.prompt runtime value.
Ties a body to another body or a world point: hinges, ropes, chains, and springs.
"Joint2D" src/runtime/index.ts:166 A radial or box-shaped light that darkens the rest of the scene around it.
"Light2D" src/runtime/index.ts:201 Allocation-free scalar math helpers for common 2D gameplay calculations.
{ clamp(value: number, min: number, max: number): number; lerp(a: number, b: number, t: number): number; inverseLerp(a: number, b: number, value: number): number; moveTowards(current: number, target: number, maxDelta: number): number; repeat(value: number, length: number): number; pingPong(value: number, length: number): number; degToRad(degrees: number): number; radToDeg(radians: number): number; approximately(a: number, b: number, epsilon?: number): boolean; } src/runtime/math/Math2D.ts:2 Math2D.approximately(a: number, b: number, epsilon?: number): boolean Compares floating-point values with a relative tolerance.
Math2D.clamp(value: number, min: number, max: number): number Constrains a scalar to an inclusive range.
Math2D.degToRad(degrees: number): number Converts degrees to radians.
Math2D.inverseLerp(a: number, b: number, value: number): number Returns the interpolation factor of value between a and b.
Math2D.lerp(a: number, b: number, t: number): number Linearly interpolates without clamping t.
Math2D.moveTowards(current: number, target: number, maxDelta: number): number Moves a scalar toward a target by no more than maxDelta.
Math2D.pingPong(value: number, length: number): number Oscillates a value between zero and length.
Math2D.radToDeg(radians: number): number Converts radians to degrees.
Math2D.repeat(value: number, length: number): number Wraps a value into the range 0..length.
Keys of T that hold a plain number, so `Tween.to` only accepts animatable properties.
type NumericKey src/runtime/tween/Tween.ts:8 OwnedEvents scripting API.
interface OwnedEvents src/runtime/events/Events.ts:44 OwnedEvents.emit<K extends EventName<TEvents>>(name: K, ...args: EventArgs<TEvents, K>): void Invokes current listeners with an optional payload.
OwnedEvents.off<K extends EventName<TEvents>>(name: K, callback: Listener<TEvents[K]>): void Removes matching listener registrations.
OwnedEvents.on<K extends EventName<TEvents>>(name: K, callback: Listener<TEvents[K]>): () => void Registers a listener and returns an unsubscribe callback. Script-owned listeners are cleaned up automatically.
Scrolls a sprite slower or faster than the camera for a depth effect.
"ParallaxLayer" src/runtime/index.ts:200 Emits and simulates a burst/stream of sprite particles. `emitting` and every visual field can be changed at runtime.
"ParticleEmitter" src/runtime/index.ts:199 ProjectData scripting API.
interface ProjectData src/shared/types/project.ts:194 ProjectData.activeSceneId: string ProjectData.activeSceneId runtime value.
ProjectData.animations: AnimationClip[] ProjectData.animations runtime value.
ProjectData.animatorControllers: AnimatorController[] ProjectData.animatorControllers runtime value.
ProjectData.assetFolders: AssetFolder[] | undefined Virtual folders shown in the Asset Browser. Optional for backwards-compatible project files.
ProjectData.assets: AssetData[] ProjectData.assets runtime value.
ProjectData.cutscenes: CutsceneData[] | undefined Multi-entity directed sequences. Optional for backwards-compatible project files.
ProjectData.id: string ProjectData.id runtime value.
ProjectData.input: InputConfiguration ProjectData.input runtime value.
ProjectData.name: string ProjectData.name runtime value.
ProjectData.prefabs: PrefabData[] ProjectData.prefabs runtime value.
ProjectData.scenes: SceneData[] ProjectData.scenes runtime value.
ProjectData.schemaVersion: 1 ProjectData.schemaVersion runtime value.
ProjectData.settings: ProjectSettings ProjectData.settings runtime value.
Marks a script field as editable through the Inspector.
property(options?: PropertyOptions): PropertyDecorator src/runtime/scripting/property.ts:17 PropertyOptions scripting API.
interface PropertyOptions src/runtime/scripting/property.ts:3 PropertyOptions.component: ComponentType | undefined Restricts an entity picker to entities carrying this component.
PropertyOptions.label: string | undefined PropertyOptions.label runtime value.
PropertyOptions.max: number | undefined PropertyOptions.max runtime value.
PropertyOptions.min: number | undefined PropertyOptions.min runtime value.
PropertyOptions.options: string[] | undefined PropertyOptions.options runtime value.
PropertyOptions.step: number | undefined PropertyOptions.step runtime value.
PropertyOptions.type: ScriptPropertyKind | undefined PropertyOptions.type runtime value.
Represents an object inside the active runtime scene.
class RuntimeEntity src/runtime/core/RuntimeEntity.ts:34 RuntimeEntity.active: boolean Alias for {@link enabled}.
RuntimeEntity.addChild(child: RuntimeEntity): void RuntimeEntity.addChild runtime operation.
RuntimeEntity.addComponent(component: EngineComponent): void Adds a component and refreshes runtime systems. Script components may be added more than once.
RuntimeEntity.addTag(tag: string): void Adds a unique serializable tag.
RuntimeEntity.children: RuntimeEntity[] Direct child entities in serialized hierarchy order.
RuntimeEntity.clone(): RuntimeEntity Clones this entity hierarchy into the active scene.
RuntimeEntity.destroy(): void Destroys this entity and all of its children.
RuntimeEntity.enabled: boolean Whether the entity is enabled in its scene.
RuntimeEntity.events: OwnedEvents<EntityEvents> Local signal bus. Script listeners are automatically removed on destruction.
RuntimeEntity.exists: boolean Whether this runtime entity still exists in the active scene.
RuntimeEntity.fadeInAudio(duration: number): void Starts (or resumes) this entity's AudioSource at zero volume and ramps up to its configured volume over `duration` seconds.
RuntimeEntity.fadeOutAudio(duration: number): void Ramps this entity's AudioSource volume down to zero over `duration` seconds, then stops it.
RuntimeEntity.getComponent(type: "Animator"): RuntimeAnimator | undefined Returns the first component of the requested type.
RuntimeEntity.getComponents<T extends ComponentType>(type: T): Extract<EngineComponent, { type: T; }>[] Returns every matching component; omit type to return all components.
RuntimeEntity.getVelocity(): SharedVector2 Returns the current Matter.js body velocity.
RuntimeEntity.hasComponent(type: ComponentType): boolean Returns whether an engine component is attached.
RuntimeEntity.hasTag(tag: string): boolean Tests whether this entity contains a tag.
RuntimeEntity.id: string RuntimeEntity.id runtime value.
RuntimeEntity.instantiate(template: EntityData | PrefabData, positionOrOptions?: Vector2Like | InstantiateOptions): RuntimeEntity Creates an independent runtime copy of entity data or a complete prefab hierarchy.
RuntimeEntity.isAudioPlaying(): boolean Whether this entity's AudioSource component is currently playing.
RuntimeEntity.layer: string Named gameplay/physics layer.
RuntimeEntity.name: string Display name serialized with the entity.
RuntimeEntity.parent: RuntimeEntity | null Parent entity, or null for a scene root.
RuntimeEntity.playAnimation(clipNameOrId: string): void Starts an Animator clip by its name or ID without restarting an already-playing clip.
RuntimeEntity.playAudio(): void Starts this entity's enabled AudioSource component.
RuntimeEntity.removeChild(child: RuntimeEntity): void RuntimeEntity.removeChild runtime operation.
RuntimeEntity.removeComponent(type: ComponentType, componentId?: string): void Removes components by type. Pass a script component ID to remove only that script instance.
RuntimeEntity.removeTag(tag: string): void Removes a tag when present.
RuntimeEntity.setActive(active: boolean): void Enables or disables this entity.
RuntimeEntity.setParent(parent: RuntimeEntity | null): void Reparents this entity while preserving its local transform values.
RuntimeEntity.setText(value: string): void Changes the first TextRenderer attached to this entity.
RuntimeEntity.setVelocity(x: number, y: number): void Sets the Matter.js body velocity.
RuntimeEntity.stopAnimation(): void Stops the animation currently playing on this entity.
RuntimeEntity.stopAudio(): void Stops and rewinds this entity's AudioSource component.
RuntimeEntity.tags: readonly string[] Serializable gameplay tags attached to the entity.
RuntimeEntity.teleport(x: number, y: number): void Moves this entity immediately while keeping its physics body synchronized.
RuntimeEntity.transform: RuntimeTransform Transform attached to this entity.
Live transform view for a runtime entity. Rotation is always measured clockwise in degrees.
class RuntimeTransform src/runtime/core/RuntimeTransform.ts:7 RuntimeTransform.localPosition: Vector2 RuntimeTransform.localPosition runtime value.
RuntimeTransform.localRotation: number RuntimeTransform.localRotation runtime value.
RuntimeTransform.localScale: Vector2 RuntimeTransform.localScale runtime value.
RuntimeTransform.localToWorld(point: Vector2Like): Vector2 RuntimeTransform.localToWorld runtime operation.
RuntimeTransform.lookAt(worldTarget: Vector2Like): void RuntimeTransform.lookAt runtime operation.
RuntimeTransform.parent: RuntimeTransform | null RuntimeTransform.parent runtime value.
RuntimeTransform.position: Vector2 World position. Setting it converts through the parent transform.
RuntimeTransform.rotate(degrees: number): void RuntimeTransform.rotate runtime operation.
RuntimeTransform.rotation: number RuntimeTransform.rotation runtime value.
RuntimeTransform.scale: Vector2 RuntimeTransform.scale runtime value.
RuntimeTransform.translate(offset: Vector2Like, local?: boolean): void RuntimeTransform.translate runtime operation.
RuntimeTransform.worldToLocal(point: Vector2Like): Vector2 RuntimeTransform.worldToLocal runtime operation.
Base class for user-authored gameplay scripts. Lifecycle for a new enabled instance: `awake → onEnable → start → update / fixedUpdate`. `awake` and `start` run exactly once per instance. Re-enabling calls `onEnable` again without repeating `start`. Disabling calls `onDisable`; removal or scene shutdown calls `onDisable` when active, followed by `onDestroy`.
class Script src/runtime/scripting/Script.ts:150 Script.awake(): void Called once immediately after the script is created and bound.
Script.entity: RuntimeEntity Script.entity runtime value.
Script.events: EventsApi Script-owned global listeners are removed automatically during onDestroy.
Script.fixedUpdate(delta: number): void Called at a fixed timestep before each physics step.
Script.game: RuntimeGameContext Pause and resume controls for the current game runtime.
Script.input: InputReader Input actions configured by the current project.
Script.onAnimationEvent(event: AnimationEvent): void Called when the active AnimationClip crosses an authored event marker. Events fire on every matching loop and on both directions of ping-pong playback.
Script.onCollisionEnter(event: CollisionEvent2D): void Called on the first physics step that touches another non-trigger collider.
Script.onCollisionExit(event: CollisionEvent2D): void Called after contact with another non-trigger collider ends.
Script.onCollisionStay(event: CollisionEvent2D): void Called on physics steps while touching another non-trigger collider.
Script.onDestroy(): void Called once immediately before the script instance is discarded.
Script.onDisable(): void Called when the script transitions from enabled to disabled.
Script.onEnable(): void Called whenever the script transitions from disabled to enabled.
Script.onTriggerEnter(event: TriggerEvent2D): void Called on the first physics step that overlaps a trigger collider.
Script.onTriggerExit(event: TriggerEvent2D): void Called after overlap with a trigger collider ends.
Script.onTriggerStay(event: TriggerEvent2D): void Called on physics steps while overlapping a trigger collider.
Script.sceneManager: RuntimeSceneManager Scene loading API for the current game.
Script.start(): void Called once before the first update, after the first onEnable call.
Script.timer: { after(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle; every(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle; cancel(handle: TimerHandle): void; pause(handle: TimerHandle): void; resume(handle: TimerHandle): void; } Script-owned timers are cancelled automatically during onDestroy.
Script.transform: RuntimeTransform Shortcut for `entity.transform`.
Script.tween: TweenApi Script-owned tweens are cancelled automatically during onDestroy.
Script.update(delta: number): void Called once per rendered frame while the script is enabled.
Mutable text component used by HUD, menus, labels, and dialog. Component token for dynamic text rendered by PixiJS.
"TextRenderer" src/runtime/index.ts:186 Public clock placeholder replaced with the active game's clock in user modules.
TimeApi src/runtime/time/Time.ts:42 Time.deltaTime: number Scaled duration of the current frame in seconds.
Time.elapsed: number Total scaled runtime duration.
Time.fixedDeltaTime: number Fixed physics timestep in seconds.
Time.frameCount: number Number of rendered runtime frames.
Time.timeScale: number Global gameplay speed. Set to zero to pause scaled gameplay.
Time.unscaledDeltaTime: number Real duration of the current frame, unaffected by timeScale.
Time.unscaledElapsed: number Total real runtime duration.
Public runtime clock. Durations are expressed in seconds; scaled values honor {@link timeScale}.
interface TimeApi src/runtime/time/Time.ts:2 TimeApi.deltaTime: number Scaled duration of the current frame in seconds.
TimeApi.elapsed: number Total scaled runtime duration.
TimeApi.fixedDeltaTime: number Fixed physics timestep in seconds.
TimeApi.frameCount: number Number of rendered runtime frames.
TimeApi.timeScale: number Global gameplay speed. Set to zero to pause scaled gameplay.
TimeApi.unscaledDeltaTime: number Real duration of the current frame, unaffected by timeScale.
TimeApi.unscaledElapsed: number Total real runtime duration.
Public timer placeholder replaced with the active game's scheduler in user modules.
TimerApi src/runtime/time/Timer.ts:69 Timer.after(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle Runs callback once after a duration. Uses scaled time unless `unscaled` is true.
Timer.cancel(handle: TimerHandle): void Permanently cancels a timer handle.
Timer.every(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle Repeats callback at an interval. Uses scaled time unless `unscaled` is true.
Timer.pause(handle: TimerHandle): void Suspends a timer without resetting its remaining duration.
Timer.resume(handle: TimerHandle): void Continues a paused timer.
TimerApi scripting API.
interface TimerApi src/runtime/time/Timer.ts:3 TimerApi.after(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle Runs callback once after a duration. Uses scaled time unless `unscaled` is true.
TimerApi.cancel(handle: TimerHandle): void Permanently cancels a timer handle.
TimerApi.every(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle Repeats callback at an interval. Uses scaled time unless `unscaled` is true.
TimerApi.pause(handle: TimerHandle): void Suspends a timer without resetting its remaining duration.
TimerApi.resume(handle: TimerHandle): void Continues a paused timer.
TimerHandle scripting API.
interface TimerHandle src/runtime/time/Timer.ts:1 TimerHandle.id: number TimerHandle.id runtime value.
TimerOptions scripting API.
interface TimerOptions src/runtime/time/Timer.ts:2 TimerOptions.unscaled: boolean | undefined TimerOptions.unscaled runtime value.
Semantic controls produced by Kriya's mobile virtual stick and action buttons. "left"/"right"/"up"/"down" are reserved for the stick; any other string is a custom button's `id`.
type TouchControl src/shared/types/project.ts:140 Stores local position, rotation, and scale for every entity.
interface Transform src/shared/types/components.ts:45 Transform.enabled: boolean Transform.enabled runtime value.
Transform.position: Vector2 Local position relative to the parent entity.
Transform.rotation: number Local clockwise rotation in degrees.
Transform.scale: Vector2 Local horizontal and vertical scale.
Transform.type: "Transform" Transform.type runtime value.
Detailed trigger overlap callback data. Extends the other collider for backward compatibility.
class TriggerEvent2D src/runtime/scripting/PhysicsEvents2D.ts:20 TriggerEvent2D.component: Collider2DComponent TriggerEvent2D.component runtime value.
TriggerEvent2D.containsPoint(point: Vector2Like): boolean Tests a world-space point against this collider's exact engine shape.
TriggerEvent2D.enabled: boolean TriggerEvent2D.enabled runtime value.
TriggerEvent2D.entity: RuntimeEntity TriggerEvent2D.entity runtime value.
TriggerEvent2D.getBounds(): Bounds2D Returns a world-axis-aligned bounding box.
TriggerEvent2D.getClosestPoint(point: Vector2Like): Vector2 Returns the closest point on or inside the collider in world space.
TriggerEvent2D.id: string TriggerEvent2D.id runtime value.
TriggerEvent2D.isTrigger: boolean TriggerEvent2D.isTrigger runtime value.
TriggerEvent2D.layer: string Collider filtering uses its owning entity's project layer.
TriggerEvent2D.material: PhysicsMaterial2D | null Physics material asset ID. Material assets are introduced in Collider Phase 2.
TriggerEvent2D.name: string TriggerEvent2D.name runtime value.
TriggerEvent2D.offset: Vector2 TriggerEvent2D.offset runtime value.
TriggerEvent2D.oneWay: boolean TriggerEvent2D.oneWay runtime value.
TriggerEvent2D.oneWayDirection: Vector2 Local direction of the solid face for one-way collision handling.
TriggerEvent2D.oneWayTolerance: number Positional tolerance in world units used near a one-way surface.
TriggerEvent2D.otherCollider: Collider2D TriggerEvent2D.otherCollider runtime value.
TriggerEvent2D.otherEntity: RuntimeEntity TriggerEvent2D.otherEntity runtime value.
TriggerEvent2D.selfCollider: Collider2D TriggerEvent2D.selfCollider runtime value.
Public tween placeholder replaced with the active game's scheduler in user modules.
TweenApi src/runtime/tween/Tween.ts:234 Tween.cancel(handle: TweenHandle): void Stops a tween where it stands, leaving the last written value in place.
Tween.cancelTarget(target: object): void Stops every tween currently writing to an object. Call before starting a competing tween.
Tween.complete(handle: TweenHandle): void Jumps straight to the end value and runs onComplete.
Tween.from<T extends object, K extends NumericKey<T>>(target: T, property: K, startValue: number, seconds: number, options?: TweenOptions): TweenHandle Animates one numeric property from `startValue` to the value it holds now. Useful for fade-ins.
Tween.isActive(handle: TweenHandle): boolean Returns whether a tween is still scheduled, whether running or paused.
Tween.pause(handle: TweenHandle): void Suspends a tween without losing its progress.
Tween.resume(handle: TweenHandle): void Continues a paused tween.
Tween.to<T extends object, K extends NumericKey<T>>(target: T, property: K, endValue: number, seconds: number, options?: TweenOptions): TweenHandle Animates one numeric property from its current value to `endValue`. The start value is read when the tween is created, not after `delay` elapses.
Tween.value(startValue: number, endValue: number, seconds: number, onUpdate: (value: number) => void, options?: TweenOptions): TweenHandle Drives a callback with an interpolated scalar instead of writing to a property.
Tween.vector(target: Vector2Like, endValue: Vector2Like, seconds: number, options?: TweenOptions): TweenHandle Animates both components of a live vector, such as a transform position.
Interpolates numeric state over time: sprite alpha, camera zoom, transform components, or any value routed through a callback. Tweens advance with scaled gameplay time unless `unscaled` is set, and script-owned tweens are cancelled automatically when their script is destroyed.
interface TweenApi src/runtime/tween/Tween.ts:32 TweenApi.cancel(handle: TweenHandle): void Stops a tween where it stands, leaving the last written value in place.
TweenApi.cancelTarget(target: object): void Stops every tween currently writing to an object. Call before starting a competing tween.
TweenApi.complete(handle: TweenHandle): void Jumps straight to the end value and runs onComplete.
TweenApi.from<T extends object, K extends NumericKey<T>>(target: T, property: K, startValue: number, seconds: number, options?: TweenOptions): TweenHandle Animates one numeric property from `startValue` to the value it holds now. Useful for fade-ins.
TweenApi.isActive(handle: TweenHandle): boolean Returns whether a tween is still scheduled, whether running or paused.
TweenApi.pause(handle: TweenHandle): void Suspends a tween without losing its progress.
TweenApi.resume(handle: TweenHandle): void Continues a paused tween.
TweenApi.to<T extends object, K extends NumericKey<T>>(target: T, property: K, endValue: number, seconds: number, options?: TweenOptions): TweenHandle Animates one numeric property from its current value to `endValue`. The start value is read when the tween is created, not after `delay` elapses.
TweenApi.value(startValue: number, endValue: number, seconds: number, onUpdate: (value: number) => void, options?: TweenOptions): TweenHandle Drives a callback with an interpolated scalar instead of writing to a property.
TweenApi.vector(target: Vector2Like, endValue: Vector2Like, seconds: number, options?: TweenOptions): TweenHandle Animates both components of a live vector, such as a transform position.
Identifies a running tween so it can be paused, cancelled, or completed early.
interface TweenHandle src/runtime/tween/Tween.ts:5 TweenHandle.id: number TweenHandle.id runtime value.
TweenOptions scripting API.
interface TweenOptions src/runtime/tween/Tween.ts:10 TweenOptions.delay: number | undefined Seconds to hold the start value before interpolation begins.
TweenOptions.easing: EasingName | EasingFunction | undefined Named curve or custom 0..1 function. Defaults to "linear".
TweenOptions.loop: boolean | undefined Restarts from the start value instead of completing. A looping tween never calls onComplete.
Runs once after the final value is written. Skipped when a tween is cancelled.
Receives every interpolated value, including the final one.
TweenOptions.pingPong: boolean | undefined Reverses direction at each end rather than restarting. Implies loop.
TweenOptions.unscaled: boolean | undefined Runs on real time, ignoring Time.timeScale.
A clickable UI element with configurable animated interaction feedback.
"UIButton" src/runtime/index.ts:189 Marks the root of a screen-space UI hierarchy (a HUD, menu, or dialog).
"UICanvas" src/runtime/index.ts:187 A non-visual layout container that arranges Anchor'd children in a row, column, or fixed-column grid.
"UIPanel" src/runtime/index.ts:193 Clips its content to its own rect and scrolls it by dragging or the mouse wheel.
"UIScrollView" src/runtime/index.ts:194 A draggable value control with a track, a fill, and a handle.
"UISlider" src/runtime/index.ts:191 A two-state switch with the same background/animation model as UIButton, plus a boolean value.
"UIToggle" src/runtime/index.ts:190 Per-player choices supplied by your consent flow; omitted fields leave the SDK value unchanged.
interface UnityAdsPrivacy src/runtime/ads/Ads.ts:62 UnityAdsPrivacy.gdprConsent: boolean | undefined UnityAdsPrivacy.gdprConsent runtime value.
UnityAdsPrivacy.privacyConsent: boolean | undefined Consent to sale/sharing of data under applicable US privacy rules.
Mutable two-dimensional vector used by the public scripting API.
class Vector2 src/runtime/math/Vector2.ts:4 Vector2.add(value: Vector2Like): Vector2 Adds a vector in place.
Vector2.clone(): Vector2 Returns an independent copy.
Vector2.divide(value: number | Vector2Like): Vector2 Divides by a scalar or component-wise vector in place. Zero divisors produce zero.
Vector2.equals(other: Vector2Like, epsilon?: number): boolean Compares components within an optional epsilon.
Vector2.length: number Vector2.length runtime value.
Vector2.lengthSquared: number Vector2.lengthSquared runtime value.
Vector2.multiply(value: number | Vector2Like): Vector2 Multiplies by a scalar or component-wise vector in place.
Vector2.normalize(): Vector2 Normalizes this vector in place.
Vector2.normalized: Vector2 Vector2.normalized runtime value.
Vector2.set(x: number, y: number): Vector2 Vector2.set runtime operation.
Vector2.subtract(value: Vector2Like): Vector2 Subtracts a vector in place.
Vector2.toJSON(): Vector2Like Vector2.toJSON runtime operation.
Vector2.x: number Vector2.x runtime value.
Vector2.y: number Vector2.y runtime value.
Vector2Like scripting API.
interface Vector2Like src/runtime/math/Vector2.ts:1 Vector2Like.x: number Vector2Like.x runtime value.
Vector2Like.y: number Vector2Like.y runtime value.
PrefabData scripting API.
interface PrefabData src/shared/types/prefab.ts:3 PrefabData.basePrefabId: string | null | undefined The prefab this one was created as a variant of, if any. Changes applied to that prefab cascade down here as long as this prefab's content is still untouched.
PrefabData.entities: EntityData[] PrefabData.entities runtime value.
PrefabData.id: string PrefabData.id runtime value.
PrefabData.name: string PrefabData.name runtime value.
PrefabData.rootEntityId: string PrefabData.rootEntityId runtime value.
PrefabData.schemaVersion: 1 PrefabData.schemaVersion runtime value.
Public placeholder replaced with queries for the active runtime scene in user modules.
SceneQuery src/runtime/scene/SceneQuery.ts:36 Scene.findAllByTag(tag: string, options?: SceneQueryOptions): RuntimeEntity[] Returns all entities carrying a tag, optionally filtered by layer.
Scene.findAllWithComponent<T>(type: ComponentQuery<T>, options?: SceneQueryOptions): RuntimeEntity[] Returns all entities with an engine component token or user Script class.
Scene.findById(id: string): RuntimeEntity | null Finds an entity by its stable serialized ID.
Scene.findByName(name: string): RuntimeEntity | null Finds the first enabled or disabled entity with an exact display name.
Scene.findByTag(tag: string, options?: SceneQueryOptions): RuntimeEntity | null Finds the first entity carrying a tag. Cache this result instead of querying every update.
Scene.findWithComponent<T>(type: ComponentQuery<T>, options?: SceneQueryOptions): RuntimeEntity | null Finds the first entity with an engine component token or user Script class.
SceneData scripting API.
interface SceneData src/shared/types/scene.ts:29 SceneData.entities: EntityData[] SceneData.entities runtime value.
SceneData.id: string SceneData.id runtime value.
SceneData.name: string SceneData.name runtime value.
SceneData.rootEntityIds: string[] SceneData.rootEntityIds runtime value.
SceneData.schemaVersion: 1 SceneData.schemaVersion runtime value.
SceneData.settings: SceneSettings | undefined SceneData.settings runtime value.
Handle for an in-flight `SceneManager.loadSceneAsync` call. Awaiting one resolves after the requested scene has become active — which is also when the scripts that started the load are destroyed, so read `entity` and its components before the await rather than after it.
interface SceneLoadOperation src/runtime/scene/SceneLoadOperation.ts:21 SceneLoadOperation.allowActivation: boolean Whether the warmed scene may swap in. Set it false to hold the loading screen up — for a minimum showing, or a "press any key" prompt — then true to hand over. Defaults to true.
SceneLoadOperation.isDone: boolean True once the requested scene has become the active scene.
SceneLoadOperation.onProgress(listener: SceneLoadProgressListener): () => void Registers a progress listener. It is called straight away with the current value, then again on every change. Returns a function that removes the listener.
SceneLoadOperation.progress: number How far the load has got, from 0 to 1. Only activation takes it to a full 1.
Progress reported while a scene loads, from 0 to 1.
SceneLoadProgressListener(progress: number): void src/runtime/scene/SceneLoadOperation.ts:2 Loads and inspects scenes in the active game runtime.
RuntimeSceneManager src/runtime/scripting/publicApi.ts:45 SceneManager.getActiveScene(): SceneData Returns the active mutable runtime scene.
SceneManager.getStartSceneName(): string Name of the scene the project starts with, ignoring any loading scene that boots ahead of it. Lets one loading screen serve every project without hard-coding a scene name.
SceneManager.loadScene(nameOrId: string): void Queues a scene by name or ID for loading before the next frame.
SceneManager.loadSceneAsync(nameOrId: string): SceneLoadOperation Warms a scene's assets in the background, then swaps to it, so a loading screen can show real progress instead of freezing on the last frame of the old scene. The handle reports progress and resolves once the scene is active. Because activation destroys the scripts that started the load, capture anything you need from `this` before awaiting.
SceneManager.reloadScene(): void Reloads the active scene from its serialized project data.
Convenience queries over the active scene. Cache results instead of repeating broad queries every update.
class SceneQuery src/runtime/scene/SceneQuery.ts:10 SceneQuery.findAllByTag(tag: string, options?: SceneQueryOptions): RuntimeEntity[] Returns all entities carrying a tag, optionally filtered by layer.
SceneQuery.findAllWithComponent<T>(type: ComponentQuery<T>, options?: SceneQueryOptions): RuntimeEntity[] Returns all entities with an engine component token or user Script class.
SceneQuery.findById(id: string): RuntimeEntity | null Finds an entity by its stable serialized ID.
SceneQuery.findByName(name: string): RuntimeEntity | null Finds the first enabled or disabled entity with an exact display name.
SceneQuery.findByTag(tag: string, options?: SceneQueryOptions): RuntimeEntity | null Finds the first entity carrying a tag. Cache this result instead of querying every update.
SceneQuery.findWithComponent<T>(type: ComponentQuery<T>, options?: SceneQueryOptions): RuntimeEntity | null Finds the first entity with an engine component token or user Script class.
SceneQueryOptions scripting API.
interface SceneQueryOptions src/runtime/scene/SceneQuery.ts:5 SceneQueryOptions.layerMask: LayerMask | undefined SceneQueryOptions.layerMask runtime value.
Reads project input actions. The runtime supplies the active implementation to user scripts.
InputApi src/runtime/scripting/publicApi.ts:20 Input.gamepadConnected(index: number): boolean Returns whether a browser gamepad slot is connected.
Input.getAxis(actionName: string): number Returns a configured/conventional axis, or -1..1 from a negative/positive action pair.
Input.getGamepadAxis(index: number, axis: number): number Reads a gamepad axis in the range -1 through 1.
Input.getGamepadButton(index: number, button: number): boolean Returns whether a gamepad button is currently pressed.
Input.getGamepadButtonDown(index: number, button: number): boolean Input.getGamepadButtonDown runtime operation.
Input.getGamepadButtonUp(index: number, button: number): boolean Input.getGamepadButtonUp runtime operation.
Input.isJustPressed(actionName: string): boolean Returns true only on the frame an input action begins.
Input.isJustReleased(actionName: string): boolean Returns true only on the frame an input action ends.
Input.isLocked(): boolean Whether gameplay input is currently silenced.
Input.isPressed(actionName: string): boolean Returns true while an input action is held.
Input.mouseButton(button: number): boolean Returns true while a zero-based mouse button is held.
Input.mouseButtonDown(button: number): boolean Returns true only on the frame a mouse button is pressed.
Input.mouseButtonUp(button: number): boolean Returns true only on the frame a mouse button is released.
Input.mousePosition: SharedVector2 Pointer position relative to the game viewport in screen pixels.
Input.mouseWorldPosition: SharedVector2 Pointer position converted through the primary runtime camera.
Input.setLocked(locked: boolean): void Silences every gameplay input read, so the player stops responding during a cutscene or a menu. Dialogue advance and UI focus navigation keep working, so a held conversation can still finish. A cutscene with "Lock player input" set does this for you.
Input.touchControl(control: TouchControl): boolean Reads one semantic virtual-stick or mobile action control.
Input.touches: readonly SharedVector2[] Active touch positions relative to the game viewport.
Input.touchStick: SharedVector2 Current virtual analog stick drag, each axis in -1..1. Zero when no stick touch is active.
InputBinding scripting API.
type InputBinding src/shared/types/project.ts:132 InputBinding.kind: "key" | "mouse" | "gamepad-button" | "gamepad-axis" | "touch" InputBinding.kind runtime value.
InputConfiguration scripting API.
interface InputConfiguration src/shared/types/project.ts:186 InputConfiguration.actions: InputActionDefinition[] InputConfiguration.actions runtime value.
InputConfiguration.deviceBindingsVersion: 1 | undefined Migration marker so user-removed gamepad/touch bindings are not recreated on every load.
InputConfiguration.touchControls: TouchControlsSettings | undefined On-screen virtual stick/button layout for touch devices. Filled in with defaults by withDefaultDeviceBindings when absent.
A text field backed by a hidden native DOM input, so typing, IME, clipboard, and the mobile keyboard work natively.
"UIInputField" src/runtime/index.ts:195 Best for walls, platforms, boxes, and simple rectangular props.
"BoxCollider2D" src/runtime/index.ts:168 Best for player characters, NPCs, and enemies.
"CapsuleCollider2D" src/runtime/index.ts:172 CapsuleQueryOptions scripting API.
interface CapsuleQueryOptions src/runtime/physics/Physics2D.ts:10 CapsuleQueryOptions.direction: "vertical" | "horizontal" | undefined CapsuleQueryOptions.direction runtime value.
CapsuleQueryOptions.includeTriggers: boolean | undefined CapsuleQueryOptions.includeTriggers runtime value.
CapsuleQueryOptions.layerMask: LayerMask | undefined CapsuleQueryOptions.layerMask runtime value.
CapsuleQueryOptions.rotation: number | undefined CapsuleQueryOptions.rotation runtime value.
Best for balls, circular objects, and inexpensive detection areas.
"CircleCollider2D" src/runtime/index.ts:170 Backend-independent collider view used by scripts, queries, and physics callbacks.
class Collider2D src/runtime/scripting/Collider2D.ts:13 Collider2D.component: Collider2DComponent Collider2D.component runtime value.
Collider2D.containsPoint(point: Vector2Like): boolean Tests a world-space point against this collider's exact engine shape.
Collider2D.enabled: boolean Collider2D.enabled runtime value.
Collider2D.entity: RuntimeEntity Collider2D.entity runtime value.
Collider2D.getBounds(): Bounds2D Returns a world-axis-aligned bounding box.
Collider2D.getClosestPoint(point: Vector2Like): Vector2 Returns the closest point on or inside the collider in world space.
Collider2D.id: string Collider2D.id runtime value.
Collider2D.isTrigger: boolean Collider2D.isTrigger runtime value.
Collider2D.layer: string Collider filtering uses its owning entity's project layer.
Collider2D.material: PhysicsMaterial2D | null Physics material asset ID. Material assets are introduced in Collider Phase 2.
Collider2D.name: string Collider2D.name runtime value.
Collider2D.offset: Vector2 Collider2D.offset runtime value.
Collider2D.oneWay: boolean Collider2D.oneWay runtime value.
Collider2D.oneWayDirection: Vector2 Local direction of the solid face for one-way collision handling.
Collider2D.oneWayTolerance: number Positional tolerance in world units used near a one-way surface.
Combines several simple shapes under one collider identity.
"CompositeCollider2D" src/runtime/index.ts:178 CompositeColliderShape2D scripting API.
type CompositeColliderShape2D src/shared/types/components.ts:622 CompositeColliderShape2D.enabled: boolean CompositeColliderShape2D.enabled runtime value.
CompositeColliderShape2D.id: string CompositeColliderShape2D.id runtime value.
CompositeColliderShape2D.name: string CompositeColliderShape2D.name runtime value.
CompositeColliderShape2D.offset: Vector2 CompositeColliderShape2D.offset runtime value.
CompositeColliderShape2D.rotation: number Clockwise local rotation in degrees.
CompositeColliderShape2D.type: "box" | "circle" | "capsule" | "polygon" CompositeColliderShape2D.type runtime value.
Best for terrain surfaces, ground contours, and open level boundaries.
"EdgeCollider2D" src/runtime/index.ts:176 Immutable collection of entity layer names used by physics and scene queries.
class LayerMask src/runtime/physics/LayerMask.ts:2 LayerMask.includes(layer: string): boolean Returns whether the mask contains a layer.
LayerMask.toArray(): string[] LayerMask.toArray runtime operation.
Public placeholder replaced with the active runtime physics query API in user modules.
Physics2DApi src/runtime/physics/Physics2D.ts:66 Physics2D.boxCast(origin: Vector2Like, size: Vector2Like, direction: Vector2Like, options?: ShapeCastOptions): RaycastHit2D | null Sweeps a box using the backend's conservative native-width query.
Physics2D.capsuleCast(origin: Vector2Like, size: Vector2Like, direction: Vector2Like, options?: ShapeCastOptions): RaycastHit2D | null Sweeps a capsule using its minor axis as the query width.
Physics2D.circleCast(origin: Vector2Like, radius: number, direction: Vector2Like, options?: ShapeCastOptions): RaycastHit2D | null Sweeps a circle and returns the nearest collider hit.
Physics2D.linecast(start: Vector2Like, end: Vector2Like, options?: PhysicsQueryOptions): RaycastHit2D | null Casts a zero-width segment from start to end.
Physics2D.overlapBox(center: Vector2Like, size: Vector2Like, options?: PhysicsQueryOptions & { rotation?: number; }): Collider2D[] Physics2D.overlapBox runtime operation.
Physics2D.overlapCapsule(center: Vector2Like, size: Vector2Like, options?: CapsuleQueryOptions): Collider2D[] Returns colliders overlapping a capsule probe.
Physics2D.overlapCircle(center: Vector2Like, radius: number, options?: PhysicsQueryOptions): Collider2D[] Returns colliders overlapping a world-space circle.
Physics2D.overlapPoint(point: Vector2Like, options?: PhysicsQueryOptions): Collider2D[] Returns colliders containing a world-space point.
Physics2D.raycast(origin: Vector2Like, direction: Vector2Like, options?: RaycastOptions): RaycastHit2D | null Casts a ray and returns the nearest hit. Triggers are excluded unless `includeTriggers` is true.
Physics2D.raycastAll(origin: Vector2Like, direction: Vector2Like, options?: RaycastOptions): RaycastHit2D[] Casts a ray and returns every matching hit sorted nearest-first.
Reusable backend-independent material applied to Collider2D shapes.
interface PhysicsMaterial2D src/shared/types/assets.ts:82 PhysicsMaterial2D.bounciness: number Elasticity in the range 0..1.
PhysicsMaterial2D.density: number Mass per unit area. Must be greater than zero.
PhysicsMaterial2D.friction: number Surface resistance in the range 0..1.
PhysicsMaterial2D.id: string PhysicsMaterial2D.id runtime value.
PhysicsMaterial2D.name: string PhysicsMaterial2D.name runtime value.
PhysicsQueryOptions scripting API.
interface PhysicsQueryOptions src/runtime/physics/Physics2D.ts:8 PhysicsQueryOptions.includeTriggers: boolean | undefined PhysicsQueryOptions.includeTriggers runtime value.
PhysicsQueryOptions.layerMask: LayerMask | undefined PhysicsQueryOptions.layerMask runtime value.
Best for irregular objects and complex static geometry; prefer simple shapes when possible.
"PolygonCollider2D" src/runtime/index.ts:174 RaycastHit2D scripting API.
interface RaycastHit2D src/runtime/physics/Physics2D.ts:12 RaycastHit2D.collider: Collider2D RaycastHit2D.collider runtime value.
RaycastHit2D.distance: number RaycastHit2D.distance runtime value.
RaycastHit2D.entity: RuntimeEntity RaycastHit2D.entity runtime value.
RaycastHit2D.normal: Vector2 RaycastHit2D.normal runtime value.
RaycastHit2D.point: Vector2 RaycastHit2D.point runtime value.
RaycastOptions scripting API.
interface RaycastOptions src/runtime/physics/Physics2D.ts:9 RaycastOptions.distance: number | undefined RaycastOptions.distance runtime value.
RaycastOptions.includeTriggers: boolean | undefined RaycastOptions.includeTriggers runtime value.
RaycastOptions.layerMask: LayerMask | undefined RaycastOptions.layerMask runtime value.
Component tokens accepted by Entity and Scene component queries.
"Rigidbody2D" src/runtime/index.ts:164 ShapeCastOptions scripting API.
interface ShapeCastOptions src/runtime/physics/Physics2D.ts:11 ShapeCastOptions.capsuleDirection: "vertical" | "horizontal" | undefined ShapeCastOptions.capsuleDirection runtime value.
ShapeCastOptions.distance: number | undefined ShapeCastOptions.distance runtime value.
ShapeCastOptions.includeTriggers: boolean | undefined ShapeCastOptions.includeTriggers runtime value.
ShapeCastOptions.layerMask: LayerMask | undefined ShapeCastOptions.layerMask runtime value.
ShapeCastOptions.rotation: number | undefined ShapeCastOptions.rotation runtime value.
Best for optimized collision geometry generated from Tilemap collision layers.
"TilemapCollider2D" src/runtime/index.ts:180 Builds optimized static collision geometry from Tilemap collision layers.
interface TilemapCollider2DComponent src/shared/types/components.ts:631 TilemapCollider2DComponent.collisionLayerIds: string[] Empty uses every enabled Tilemap layer marked for collision.
TilemapCollider2DComponent.enabled: boolean TilemapCollider2DComponent.enabled runtime value.
TilemapCollider2DComponent.id: string Stable instance ID used when an entity owns multiple colliders.
TilemapCollider2DComponent.isTrigger: boolean TilemapCollider2DComponent.isTrigger runtime value.
TilemapCollider2DComponent.materialId: string | null Reserved asset ID for the reusable PhysicsMaterial2D system.
TilemapCollider2DComponent.mergeAdjacent: boolean Greedily merges adjacent solid cells into larger rectangles.
TilemapCollider2DComponent.name: string Optional gameplay-facing name, such as MainBody or Feet.
TilemapCollider2DComponent.offset: Vector2 TilemapCollider2DComponent.offset runtime value.
TilemapCollider2DComponent.oneWay: boolean Makes compatible solid colliders passable from the back side.
TilemapCollider2DComponent.oneWayDirection: Vector2 World-facing local direction of the solid side.
TilemapCollider2DComponent.oneWayTolerance: number TilemapCollider2DComponent.oneWayTolerance runtime value.
TilemapCollider2DComponent.type: "TilemapCollider2D" TilemapCollider2DComponent.type runtime value.
Serializable property or sprite animation asset.
interface AnimationClip src/shared/types/animation.ts:93 AnimationClip.duration: number AnimationClip.duration runtime value.
AnimationClip.events: AnimationEventMarker[] | undefined Authored callbacks fired when playback crosses their timeline position.
AnimationClip.fps: number | undefined Global frame rate for sprite clips.
AnimationClip.frames: SpriteAnimationFrame[] | undefined Ordered sprite-frame asset references.
AnimationClip.id: string AnimationClip.id runtime value.
AnimationClip.loop: boolean AnimationClip.loop runtime value.
AnimationClip.name: string AnimationClip.name runtime value.
AnimationClip.playback: AnimationPlaybackMode | undefined Explicit playback behavior. `loop` remains for backwards compatibility.
AnimationClip.speed: number AnimationClip.speed runtime value.
AnimationClip.tracks: AnimationTrack[] AnimationClip.tracks runtime value.
AnimationClip.type: "property" | "sprite" | undefined Legacy/property clips default to `property`; newly-created frame clips use `sprite`.
AnimationClip.visualAlignment: SpriteAnimationVisualAlignment | undefined Visual-only correction shared by every frame in a sprite clip.
Runtime payload delivered to Script.onAnimationEvent when playback crosses a marker.
interface AnimationEvent src/shared/types/animation.ts:77 AnimationEvent.booleanValue: boolean | undefined Optional authored boolean parameter.
AnimationEvent.frame: number Zero-based sprite frame index, or -1 for property clips.
AnimationEvent.name: string Authored marker name used to select gameplay behavior.
AnimationEvent.normalizedTime: number Marker time divided by the authored clip duration, in the range zero through one.
AnimationEvent.numberValue: number | undefined Optional authored numeric parameter.
AnimationEvent.stringValue: string | undefined Optional authored string parameter.
Serializable event marker authored on an AnimationClip timeline.
interface AnimationEventMarker src/shared/types/animation.ts:57 AnimationEventMarker.booleanValue: boolean | undefined AnimationEventMarker.booleanValue runtime value.
AnimationEventMarker.frameId: string | undefined Optional sprite frame identity used to keep frame-authored events attached while reordering.
AnimationEventMarker.id: string AnimationEventMarker.id runtime value.
AnimationEventMarker.name: string AnimationEventMarker.name runtime value.
AnimationEventMarker.numberValue: number | undefined AnimationEventMarker.numberValue runtime value.
AnimationEventMarker.stringValue: string | undefined AnimationEventMarker.stringValue runtime value.
AnimationEventMarker.time: number Local clip time in seconds.
AnimationPlaybackMode scripting API.
type AnimationPlaybackMode src/shared/types/animation.ts:39 One named state backed by an AnimationClip asset.
interface AnimationState src/shared/types/animator.ts:15 AnimationState.clipId: string | null AnimationState.clipId runtime value.
AnimationState.id: string AnimationState.id runtime value.
AnimationState.name: string AnimationState.name runtime value.
AnimationState.position: Vector2 AnimationState.position runtime value.
AnimationState.speed: number AnimationState.speed runtime value.
Animator scripting API.
"Animator" src/runtime/index.ts:181 Serializable state machine used by Animator components.
interface AnimatorController src/shared/types/animator.ts:47 AnimatorController.defaultStateId: string | null AnimatorController.defaultStateId runtime value.
AnimatorController.id: string AnimatorController.id runtime value.
AnimatorController.name: string AnimatorController.name runtime value.
AnimatorController.parameters: AnimatorParameter[] AnimatorController.parameters runtime value.
AnimatorController.states: AnimationState[] AnimatorController.states runtime value.
AnimatorController.transitions: AnimatorTransition[] AnimatorController.transitions runtime value.
Serializable parameter declaration and its initial value.
interface AnimatorParameter src/shared/types/animator.ts:7 AnimatorParameter.defaultValue: number | boolean AnimatorParameter.defaultValue runtime value.
AnimatorParameter.id: string AnimatorParameter.id runtime value.
AnimatorParameter.name: string AnimatorParameter.name runtime value.
AnimatorParameter.type: AnimatorParameterType AnimatorParameter.type runtime value.
Supported Animator Controller parameter kinds.
type AnimatorParameterType src/shared/types/animator.ts:4 Directed state-machine transition. `fromStateId: null` means Any State.
interface AnimatorTransition src/shared/types/animator.ts:34 AnimatorTransition.conditions: AnimatorTransitionCondition[] AnimatorTransition.conditions runtime value.
AnimatorTransition.duration: number Reserved state timing in seconds; sprite textures are not cross-faded.
AnimatorTransition.exitTime: number Normalized state time. A value of 1 waits for one complete playback.
AnimatorTransition.fromStateId: string | null AnimatorTransition.fromStateId runtime value.
AnimatorTransition.hasExitTime: boolean AnimatorTransition.hasExitTime runtime value.
AnimatorTransition.id: string AnimatorTransition.id runtime value.
AnimatorTransition.toStateId: string AnimatorTransition.toStateId runtime value.
Parameter predicate required by a transition.
interface AnimatorTransitionCondition src/shared/types/animator.ts:26 AnimatorTransitionCondition.id: string AnimatorTransitionCondition.id runtime value.
AnimatorTransitionCondition.operator: AnimatorConditionOperator AnimatorTransitionCondition.operator runtime value.
AnimatorTransitionCondition.parameterId: string AnimatorTransitionCondition.parameterId runtime value.
AnimatorTransitionCondition.value: number | boolean AnimatorTransitionCondition.value runtime value.
Public script-facing controller for an Entity's Animator component.
class RuntimeAnimator src/runtime/animation/RuntimeAnimator.ts:26 RuntimeAnimator.currentAnimation: string | null Current AnimationClip name.
RuntimeAnimator.currentState: string | null Current controller state name, or null for direct clip playback.
RuntimeAnimator.getBool(name: string): boolean Returns a Bool parameter, or false when it is missing.
RuntimeAnimator.getFloat(name: string): number Returns a Float parameter, or zero when it is missing.
RuntimeAnimator.getInteger(name: string): number Returns an Integer parameter, or zero when it is missing.
RuntimeAnimator.hasAnimation(name: string): boolean Returns whether the Animator can play a named AnimationClip.
RuntimeAnimator.hasState(name: string): boolean Returns whether the assigned controller contains a state.
RuntimeAnimator.isPlaying: boolean Whether animation time is currently advancing.
RuntimeAnimator.normalizedTime: number Elapsed state time divided by clip duration. Looping states may exceed one.
RuntimeAnimator.onComplete(animationName: string, callback: () => void): () => void Runs a callback when a state or clip completes. Looping clips notify once per cycle. The returned function unsubscribes early; Script-owned subscriptions are also removed automatically when their Script is destroyed.
RuntimeAnimator.pause(): void Pauses playback at the current frame.
RuntimeAnimator.play(stateOrClipName: string): void Plays a controller state, or an AnimationClip when no matching state exists.
RuntimeAnimator.playClip(clip: AnimationClip | string): void Directly plays an AnimationClip reference, name, or ID. State playback remains recommended.
RuntimeAnimator.resetTrigger(name: string): void Clears a Trigger parameter without taking a transition.
RuntimeAnimator.resume(): void Resumes playback from the current frame.
RuntimeAnimator.setBool(name: string, value: boolean): void Sets a Bool parameter used by controller transitions.
RuntimeAnimator.setFloat(name: string, value: number): void Sets a Float parameter used by controller transitions.
RuntimeAnimator.setInteger(name: string, value: number): void Sets an Integer parameter used by controller transitions.
RuntimeAnimator.setTrigger(name: string): void Arms a Trigger parameter until a matching transition consumes it.
RuntimeAnimator.speed: number Effective component playback multiplier.
RuntimeAnimator.stop(): void Stops playback and rewinds the current state.
One sprite frame reference and optional timing override.
interface SpriteAnimationFrame src/shared/types/animation.ts:32 SpriteAnimationFrame.duration: number | undefined When omitted, duration is derived from the clip FPS.
SpriteAnimationFrame.id: string SpriteAnimationFrame.id runtime value.
SpriteAnimationFrame.spriteAssetId: string SpriteAnimationFrame.spriteAssetId runtime value.
Motion and color-transition settings applied as a UIButton changes interaction state.
interface UIButtonAnimationConfig src/shared/types/components.ts:194 UIButtonAnimationConfig.easing: UIButtonAnimationEasing UIButtonAnimationConfig.easing runtime value.
UIButtonAnimationConfig.enabled: boolean UIButtonAnimationConfig.enabled runtime value.
UIButtonAnimationConfig.focusedScale: number UIButtonAnimationConfig.focusedScale runtime value.
UIButtonAnimationConfig.focusPulse: boolean UIButtonAnimationConfig.focusPulse runtime value.
UIButtonAnimationConfig.focusPulseAmount: number UIButtonAnimationConfig.focusPulseAmount runtime value.
UIButtonAnimationConfig.focusPulseSpeed: number Focus pulse cycles per second.
UIButtonAnimationConfig.hoverScale: number UIButtonAnimationConfig.hoverScale runtime value.
UIButtonAnimationConfig.pressDuration: number Duration in seconds for the faster pressed-state response.
UIButtonAnimationConfig.pressedScale: number UIButtonAnimationConfig.pressedScale runtime value.
UIButtonAnimationConfig.releaseBounce: number Temporary scale overshoot after releasing a pressed button.
UIButtonAnimationConfig.transitionDuration: number Duration in seconds for hover, focus, disabled, and release transitions.
UIButtonAnimationEasing scripting API.
type UIButtonAnimationEasing src/shared/types/components.ts:191 Cursor-hover motion for any anchored UI visual.
"UIHoverAnimation" src/runtime/index.ts:192 Adds cursor-hover motion to any anchored UI image, text, button, or panel background.
interface UIHoverAnimationComponent src/shared/types/components.ts:334 UIHoverAnimationComponent.easing: UIButtonAnimationEasing UIHoverAnimationComponent.easing runtime value.
UIHoverAnimationComponent.enabled: boolean UIHoverAnimationComponent.enabled runtime value.
UIHoverAnimationComponent.hoverAlpha: number Target opacity at full hover.
UIHoverAnimationComponent.hoverOffset: Vector2 Screen-pixel offset applied at full hover.
UIHoverAnimationComponent.hoverRotation: number Clockwise rotation in degrees applied at full hover.
UIHoverAnimationComponent.hoverScale: number Scale multiplier around the element's UI rectangle center.
UIHoverAnimationComponent.pointerCursor: boolean Shows a pointer cursor while the element is hovered.
UIHoverAnimationComponent.transitionDuration: number Duration in seconds when entering or leaving the hovered state.
UIHoverAnimationComponent.type: "UIHoverAnimation" UIHoverAnimationComponent.type runtime value.
Drives the active scene's primary Camera2D: follow, zoom, bounds, shake, and screen/world conversion. The runtime supplies the active implementation to user scripts.
CameraApi src/runtime/scripting/publicApi.ts:120 Camera.clearBounds(): void Camera.clearBounds runtime operation.
Camera.entity: RuntimeEntity | null The entity holding the primary Camera2D, or null when the scene has none.
Camera.exists: boolean Whether the scene currently has an enabled primary camera to drive.
Camera.follow(target: RuntimeEntity | null, smoothing?: number): void Follows an entity, easing toward it at `smoothing` (higher is snappier). Pass null to detach and hand control back to the camera entity's own transform.
Camera.following: RuntimeEntity | null Entity the camera is following, or null.
Camera.position: Vector2 World point the view is centred on, already clamped to the camera bounds. Assigning moves the camera entity, which only changes the view while nothing is being followed.
Camera.screenToWorld(point: Vector2Like, viewport?: Vector2Like): Vector2 Converts a viewport pixel position into world space.
Camera.setBounds(min: Vector2Like, max: Vector2Like): void Constrains the centre of the view to a world-space rectangle.
Camera.shake(intensity: number, seconds: number, options?: CameraShakeOptions): void Offsets the rendered view for a burst of impact. Cosmetic only: it never moves the camera entity, and never shifts where a screen point lands in the world.
Camera.stopShake(): void Ends an active shake immediately and recentres the view.
Camera.viewport: Vector2 Logical viewport size in pixels.
Camera.worldToScreen(point: Vector2Like, viewport?: Vector2Like): Vector2 Converts a world position into viewport pixels.
Camera.zoom: number Rendered magnification. The renderer clamps the applied value to 0.15..4.
Camera2D scripting API.
"Camera2D" src/runtime/index.ts:182 Reads and drives the scene's primary Camera2D without hunting for its entity first. Every member no-ops or returns a neutral value while the scene has no enabled primary camera.
interface CameraApi src/runtime/camera/Camera.ts:17 CameraApi.clearBounds(): void CameraApi.clearBounds runtime operation.
CameraApi.entity: RuntimeEntity | null The entity holding the primary Camera2D, or null when the scene has none.
CameraApi.exists: boolean Whether the scene currently has an enabled primary camera to drive.
CameraApi.follow(target: RuntimeEntity | null, smoothing?: number): void Follows an entity, easing toward it at `smoothing` (higher is snappier). Pass null to detach and hand control back to the camera entity's own transform.
CameraApi.following: RuntimeEntity | null Entity the camera is following, or null.
CameraApi.position: Vector2 World point the view is centred on, already clamped to the camera bounds. Assigning moves the camera entity, which only changes the view while nothing is being followed.
CameraApi.screenToWorld(point: Vector2Like, viewport?: Vector2Like): Vector2 Converts a viewport pixel position into world space.
CameraApi.setBounds(min: Vector2Like, max: Vector2Like): void Constrains the centre of the view to a world-space rectangle.
CameraApi.shake(intensity: number, seconds: number, options?: CameraShakeOptions): void Offsets the rendered view for a burst of impact. Cosmetic only: it never moves the camera entity, and never shifts where a screen point lands in the world.
CameraApi.stopShake(): void Ends an active shake immediately and recentres the view.
CameraApi.viewport: Vector2 Logical viewport size in pixels.
CameraApi.worldToScreen(point: Vector2Like, viewport?: Vector2Like): Vector2 Converts a world position into viewport pixels.
CameraApi.zoom: number Rendered magnification. The renderer clamps the applied value to 0.15..4.
CameraShakeOptions scripting API.
interface CameraShakeOptions src/runtime/camera/Camera.ts:6 CameraShakeOptions.frequency: number | undefined New shake direction picks per second. Lower is a slow sway, higher is a buzz. Defaults to 24.
CameraShakeOptions.unscaled: boolean | undefined Runs on real time, ignoring Time.timeScale.
SpriteRenderer scripting API.
"SpriteRenderer" src/runtime/index.ts:184 Tilemap scripting API.
"Tilemap" src/runtime/index.ts:203 TilemapAutotile scripting API.
interface TilemapAutotile src/shared/types/components.ts:721 TilemapAutotile.baseTile: number Palette tile used as the start of the default sequential 16-tile rule set.
TilemapAutotile.enabled: boolean TilemapAutotile.enabled runtime value.
TilemapAutotile.ruleTiles: number[] Tile index for every 4-neighbor mask from 0 through 15.
TilemapLayer scripting API.
interface TilemapLayer src/shared/types/components.ts:704 TilemapLayer.animationClipId: string | null | undefined Optional sprite animation used as an animated tile for every occupied cell in this layer.
TilemapLayer.autotile: TilemapAutotile | undefined Optional 4-neighbor autotile mapping. Rule index bits are north=1, east=2, south=4, west=8.
TilemapLayer.collision: boolean TilemapLayer.collision runtime value.
TilemapLayer.enabled: boolean TilemapLayer.enabled runtime value.
TilemapLayer.id: string TilemapLayer.id runtime value.
TilemapLayer.name: string TilemapLayer.name runtime value.
TilemapLayer.opacity: number TilemapLayer.opacity runtime value.
TilemapLayer.tileRotations: number[] | undefined Per-cell clockwise rotation in degrees. Missing entries are treated as 0 degrees.
TilemapLayer.tiles: number[] TilemapLayer.tiles runtime value.
TilemapLayer.tilesetAssetId: string | null | undefined Overrides the Tilemap's default tileset for this layer.
Runtime audio bus mixer: adjust Master/Music/SFX/UI volumes and mute state. The runtime supplies the active implementation to user scripts.
AudioMixerApi src/runtime/scripting/publicApi.ts:106 Audio.getBusVolume(bus: Exclude<AudioBus, "master">): number Audio.getBusVolume runtime operation.
Audio.getMasterVolume(): number Audio.getMasterVolume runtime operation.
Audio.isMuted(): boolean Audio.isMuted runtime operation.
Audio.playOneShot(assetId: string, options?: AudioOneShotOptions): void Plays an audio asset once, independent of any AudioSource component. Fire-and-forget.
Audio.setBusVolume(bus: Exclude<AudioBus, "master">, value: number): void Audio.setBusVolume runtime operation.
Audio.setMasterVolume(value: number): void Audio.setMasterVolume runtime operation.
Audio.setMuted(muted: boolean): void Audio.setMuted runtime operation.
AudioMixerApi scripting API.
interface AudioMixerApi src/runtime/audio/AudioMixer.ts:14 AudioMixerApi.getBusVolume(bus: Exclude<AudioBus, "master">): number AudioMixerApi.getBusVolume runtime operation.
AudioMixerApi.getMasterVolume(): number AudioMixerApi.getMasterVolume runtime operation.
AudioMixerApi.isMuted(): boolean AudioMixerApi.isMuted runtime operation.
AudioMixerApi.playOneShot(assetId: string, options?: AudioOneShotOptions): void Plays an audio asset once, independent of any AudioSource component. Fire-and-forget.
AudioMixerApi.setBusVolume(bus: Exclude<AudioBus, "master">, value: number): void AudioMixerApi.setBusVolume runtime operation.
AudioMixerApi.setMasterVolume(value: number): void AudioMixerApi.setMasterVolume runtime operation.
AudioMixerApi.setMuted(muted: boolean): void AudioMixerApi.setMuted runtime operation.
AudioOneShotOptions scripting API.
interface AudioOneShotOptions src/runtime/audio/AudioMixer.ts:7 AudioOneShotOptions.bus: "music" | "sfx" | "ui" | undefined Bus the one-shot mixes into. Defaults to "sfx".
AudioOneShotOptions.volume: number | undefined Multiplier applied on top of the bus/master volume. Defaults to 1.
AudioSource scripting API.
"AudioSource" src/runtime/index.ts:183 Persistent key-value store for game progress. The runtime supplies the active implementation to user scripts.
SaveApi src/runtime/scripting/publicApi.ts:56 Save.clear(): void Clears this store's values. Root clear preserves named slots.
Save.delete(key: string): void Save.delete runtime operation.
Save.deleteSlot(name: string): void Removes a slot without changing shared settings or other slots.
Save.flush(): Promise<void> Waits for all writes queued so far; rejects if the latest write fails.
Save.get<T = unknown>(key: string, fallback?: T | null): T | null Returns a detached saved value, or the fallback (null by default).
Save.has(key: string): boolean Save.has runtime operation.
Save.keys(): string[] Save.keys runtime operation.
Save.set(key: string, value: unknown): void Stores a detached JSON snapshot and queues persistence.
Save.slot(name: string): SaveStore Gets an independent progress slot. First mutation creates it.
Save.slots(): string[] Lists existing slot names alphabetically.
Root values are shared settings; named slots keep independent game progress.
interface SaveApi src/runtime/save/SaveSystem.ts:19 SaveApi.clear(): void Clears this store's values. Root clear preserves named slots.
SaveApi.delete(key: string): void SaveApi.delete runtime operation.
SaveApi.deleteSlot(name: string): void Removes a slot without changing shared settings or other slots.
SaveApi.flush(): Promise<void> Waits for all writes queued so far; rejects if the latest write fails.
SaveApi.get<T = unknown>(key: string, fallback?: T | null): T | null Returns a detached saved value, or the fallback (null by default).
SaveApi.has(key: string): boolean SaveApi.has runtime operation.
SaveApi.keys(): string[] SaveApi.keys runtime operation.
SaveApi.set(key: string, value: unknown): void Stores a detached JSON snapshot and queues persistence.
SaveApi.slot(name: string): SaveStore Gets an independent progress slot. First mutation creates it.
SaveApi.slots(): string[] Lists existing slot names alphabetically.
SaveData scripting API.
type SaveData src/runtime/save/SaveSystem.ts:1 A JSON key-value store. Mutations save automatically; await flush before confirming success.
interface SaveStore src/runtime/save/SaveSystem.ts:4 SaveStore.clear(): void Clears this store's values. Root clear preserves named slots.
SaveStore.delete(key: string): void SaveStore.delete runtime operation.
SaveStore.flush(): Promise<void> Waits for all writes queued so far; rejects if the latest write fails.
SaveStore.get<T = unknown>(key: string, fallback?: T | null): T | null Returns a detached saved value, or the fallback (null by default).
SaveStore.has(key: string): boolean SaveStore.has runtime operation.
SaveStore.keys(): string[] SaveStore.keys runtime operation.
SaveStore.set(key: string, value: unknown): void Stores a detached JSON snapshot and queues persistence.