Kriya documentation

Build the scene.
Script the behavior.

Learn the runtime model, author TypeScript gameplay, connect an AI agent through MCP, and ship the same project across platforms.

Engine
0.5.0
Engine API entries
667
Top-level symbols
106

Quick start

Your first gameplay script.

Create a TypeScript asset, attach it through a Script component, then press Play. Kriya compiles project scripts and reports diagnostics inside the editor.
  1. CreateChoose Script in the Project panel and save a default-exported class.
  2. AttachAdd a Script component to an entity and select the script asset.
  3. PlayRun the isolated Play Mode. Stop restores the untouched editor project.
PlayerController.ts
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;
  }
}
Script imports

Use @engine/runtime for public engine APIs. Relative imports between project scripts are supported; editor modules are not.

Scripting lifecycle

Every callback has one job.

A script is bound to its entity before lifecycle execution. Failures are isolated per callback and reported with script locations.
awakeOnce, immediately after bindings exist.
onEnableWhenever the script becomes enabled.
startOnce, before the first update.
updateEvery rendered frame.
fixedUpdateBefore each physics step.
onDisableWhen the active script is disabled.
onDestroyOnce, before the instance is discarded.

Physics callbacks

onCollisionEnter, Stay, and Exit receive non-trigger contacts. Trigger variants receive overlaps.

Owned resources

this.timer and this.events clean up script-owned timers and listeners automatically on destruction.

Inspector properties

Expose tuning without writing UI.

The @property() decorator turns script fields into serialized Inspector controls with labels, ranges, steps, and options.
Editable script fields
@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

Small APIs that compose.

Runtime modules are React-free and operate on the active serialized scene, physics world, input map, and game services.

Scene

Find entities by name, ID, tag, layer, or attached component.

Open reference

Input

Read named actions, pointer state, touch controls, and gamepads.

Open reference

Physics2D

Raycast, shape cast, and overlap against the Matter.js world.

Open reference

Timer

Schedule scaled or unscaled callbacks with automatic script cleanup.

Open reference

Events

Publish typed global signals or listen through an entity-local event bus.

Open reference

Navigation

Find deterministic A* paths across collision-enabled Tilemap layers.

Open reference

Save

Persist JSON-serializable progress, settings, checkpoints, and scores.

Open reference

Dialogue

Start, advance, branch, and end authored DialogueBox conversations.

Open reference
Scene and physics query
import { 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

Compose entities from focused parts.

Every entity owns a required Transform. Other components add rendering, physics, animation, audio, scripts, tilemaps, cameras, UI, and dialogue.

Core

  • Transform
  • Script

Rendering

  • SpriteRenderer
  • TextRenderer
  • ParticleEmitter
  • ParallaxLayer
  • Light2D
  • Tilemap

Physics

  • Rigidbody2D
  • BoxCollider2D
  • CircleCollider2D
  • CapsuleCollider2D
  • PolygonCollider2D
  • EdgeCollider2D
  • CompositeCollider2D
  • TilemapCollider2D

Interface

  • UICanvas
  • Anchor
  • UIButton
  • UIHoverAnimation
  • UIPanel
  • DialogueBox

Gameplay

  • Camera2D
  • Animator
  • AudioSource
Runtime entity access

Use getComponent(), getComponents(), hasComponent(), addComponent(), and removeComponent(). Transform cannot be removed.

MCP and AI agents

Let an agent work on the active project.

Kriya's desktop MCP server exposes structured tools for scenes, entities, components, assets, scripts, input, animation, prefabs, navigation, and builds.
  1. Open setupChoose Help, then MCP Server Setup in the desktop editor.
  2. Copy onceAdd the generated stdio configuration to your MCP client.
  3. Go liveUse the MCP Offline button to synchronize the project currently open in Kriya.

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

Search the public runtime surface.

These symbols are generated from the same TypeScript source and TSDoc used by Monaco autocomplete and Kriya's built-in Help.

106 top-level symbols

Anchor

Positions and sizes an entity in screen pixels relative to its nearest UICanvas or Anchor ancestor.

"Anchor"
src/runtime/index.ts:136
AnchorPoint

The nine screen-relative anchor points, or "stretch" to fill the parent rect inset by offset.

type AnchorPoint
src/shared/types/components.ts:173
AssetData

AssetData scripting API.

interface AssetData
src/shared/types/assets.ts:47

Members

animationClipId

property
AssetData.animationClipId: string | undefined

Links an editor-visible `.anim` asset to ProjectData.animations.

animatorControllerId

property
AssetData.animatorControllerId: string | undefined

Links an editor-visible controller asset to ProjectData.animatorControllers.

compiledSource

property
AssetData.compiledSource: string | undefined

AssetData.compiledSource runtime value.

diagnostics

property
AssetData.diagnostics: string[] | undefined

AssetData.diagnostics runtime value.

folderId

property
AssetData.folderId: string | null | undefined

Virtual Asset Browser folder. Null or omitted places the asset at the project root.

height

property
AssetData.height: number | undefined

AssetData.height runtime value.

id

property
AssetData.id: string

AssetData.id runtime value.

mimeType

property
AssetData.mimeType: string

AssetData.mimeType runtime value.

missing

property
AssetData.missing: boolean | undefined

Editor-only status set when sourcePath cannot be read.

name

property
AssetData.name: string

AssetData.name runtime value.

physicsMaterial

property
AssetData.physicsMaterial: PhysicsMaterial2D | undefined

AssetData.physicsMaterial runtime value.

scriptProperties

property
AssetData.scriptProperties: ScriptPropertyMetadata[] | undefined

AssetData.scriptProperties runtime value.

size

property
AssetData.size: number

AssetData.size runtime value.

sourceChanged

property
AssetData.sourceChanged: boolean | undefined

Editor-only status set when the external source differs from the last saved project metadata.

sourceMap

property
AssetData.sourceMap: ScriptSourceMap | undefined

AssetData.sourceMap runtime value.

sourceModifiedAt

property
AssetData.sourceModifiedAt: number | undefined

Last filesystem modification time observed when the external source was saved or loaded.

sourcePath

property
AssetData.sourcePath: string | undefined

Project-relative source file used by desktop projects. Browser projects keep using inline src data.

sourceText

property
AssetData.sourceText: string | undefined

AssetData.sourceText runtime value.

spriteFrame

property
AssetData.spriteFrame: SpriteFrameData | undefined

AssetData.spriteFrame runtime value.

spriteImport

property
AssetData.spriteImport: SpriteImportSettings | undefined

AssetData.spriteImport runtime value.

src

property
AssetData.src: string

Resolved data URL while the project is open; omitted from desktop project files for external assets.

type

property
AssetData.type: AssetType

AssetData.type runtime value.

width

property
AssetData.width: number | undefined

AssetData.width runtime value.

Bounds2D

Bounds2D scripting API.

interface Bounds2D
src/runtime/scripting/Collider2D.ts:5

Members

center

property
Bounds2D.center: Vector2

Bounds2D.center runtime value.

max

property
Bounds2D.max: Vector2

Bounds2D.max runtime value.

min

property
Bounds2D.min: Vector2

Bounds2D.min runtime value.

size

property
Bounds2D.size: Vector2

Bounds2D.size runtime value.

CollisionEvent2D

Detailed non-trigger collision callback data. Extends the other collider for backward compatibility.

class CollisionEvent2D
src/runtime/scripting/PhysicsEvents2D.ts:8

Members

component

property
CollisionEvent2D.component: Collider2DComponent

CollisionEvent2D.component runtime value.

contacts

property
CollisionEvent2D.contacts: ContactPoint2D[]

CollisionEvent2D.contacts runtime value.

containsPoint

method
CollisionEvent2D.containsPoint(point: Vector2Like): boolean

Tests a world-space point against this collider's exact engine shape.

enabled

property
CollisionEvent2D.enabled: boolean

CollisionEvent2D.enabled runtime value.

entity

property
CollisionEvent2D.entity: RuntimeEntity

CollisionEvent2D.entity runtime value.

getBounds

method
CollisionEvent2D.getBounds(): Bounds2D

Returns a world-axis-aligned bounding box.

getClosestPoint

method
CollisionEvent2D.getClosestPoint(point: Vector2Like): Vector2

Returns the closest point on or inside the collider in world space.

id

property
CollisionEvent2D.id: string

CollisionEvent2D.id runtime value.

isTrigger

property
CollisionEvent2D.isTrigger: boolean

CollisionEvent2D.isTrigger runtime value.

layer

property
CollisionEvent2D.layer: string

Collider filtering uses its owning entity's project layer.

material

property
CollisionEvent2D.material: PhysicsMaterial2D | null

Physics material asset ID. Material assets are introduced in Collider Phase 2.

name

property
CollisionEvent2D.name: string

CollisionEvent2D.name runtime value.

normal

property
CollisionEvent2D.normal: Vector2

CollisionEvent2D.normal runtime value.

offset

property
CollisionEvent2D.offset: Vector2

CollisionEvent2D.offset runtime value.

oneWay

property
CollisionEvent2D.oneWay: boolean

CollisionEvent2D.oneWay runtime value.

oneWayDirection

property
CollisionEvent2D.oneWayDirection: Vector2

Local direction of the solid face for one-way collision handling.

oneWayTolerance

property
CollisionEvent2D.oneWayTolerance: number

Positional tolerance in world units used near a one-way surface.

otherCollider

property
CollisionEvent2D.otherCollider: Collider2D

CollisionEvent2D.otherCollider runtime value.

otherEntity

property
CollisionEvent2D.otherEntity: RuntimeEntity

CollisionEvent2D.otherEntity runtime value.

relativeVelocity

property
CollisionEvent2D.relativeVelocity: Vector2

CollisionEvent2D.relativeVelocity runtime value.

selfCollider

property
CollisionEvent2D.selfCollider: Collider2D

CollisionEvent2D.selfCollider runtime value.

ComponentConstructor

ComponentConstructor scripting API.

type ComponentConstructor
src/runtime/scene/SceneQuery.ts:6

Members

name

property
ComponentConstructor.name: string

ComponentConstructor.name runtime value.

ComponentQuery

ComponentQuery scripting API.

type ComponentQuery
src/runtime/scene/SceneQuery.ts:7
ContactPoint2D

One contact generated by a non-trigger collision.

interface ContactPoint2D
src/runtime/scripting/PhysicsEvents2D.ts:5

Members

normal

property
ContactPoint2D.normal: Vector2

ContactPoint2D.normal runtime value.

point

property
ContactPoint2D.point: Vector2

ContactPoint2D.point runtime value.

separation

property
ContactPoint2D.separation: number

ContactPoint2D.separation runtime value.

Debug

Writes messages to the game console and the editor Console during Play Mode.

class Debug
src/runtime/scripting/Debug.ts:10
destroy

Destroys an entity. With no argument, a script destroys its own entity.

destroy(target?: RuntimeEntity): void
src/runtime/scripting/publicApi.ts:102
Dialogue

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:61

Members

advance

method
Dialogue.advance(entityId: string): void

Advances past the current line. No-op while the line has choices — pick one with choose() instead.

choose

method
Dialogue.choose(entityId: string, choiceId: string): void

Dialogue.choose runtime operation.

currentLineId

method
Dialogue.currentLineId(entityId: string): string | null

Dialogue.currentLineId runtime operation.

end

method
Dialogue.end(entityId: string): void

Ends the conversation early, destroying any spawned choice buttons and disabling the subtree.

isActive

method
Dialogue.isActive(entityId: string): boolean

Dialogue.isActive runtime operation.

start

method
Dialogue.start(entityId: string): void

Enables the DialogueBox entity's whole subtree and jumps to its startLineId.

DialogueApi

Public shape of the Dialogue API exposed to scripts.

interface DialogueApi
src/runtime/dialogue/DialogueSystem.ts:14

Members

advance

method
DialogueApi.advance(entityId: string): void

Advances past the current line. No-op while the line has choices — pick one with choose() instead.

choose

method
DialogueApi.choose(entityId: string, choiceId: string): void

DialogueApi.choose runtime operation.

currentLineId

method
DialogueApi.currentLineId(entityId: string): string | null

DialogueApi.currentLineId runtime operation.

end

method
DialogueApi.end(entityId: string): void

Ends the conversation early, destroying any spawned choice buttons and disabling the subtree.

isActive

method
DialogueApi.isActive(entityId: string): boolean

DialogueApi.isActive runtime operation.

start

method
DialogueApi.start(entityId: string): void

Enables the DialogueBox entity's whole subtree and jumps to its startLineId.

DialogueBox

A linear conversation with optional branching choices, driven by the runtime DialogueSystem.

"DialogueBox"
src/runtime/index.ts:140
DialogueChoice

One clickable option shown when a DialogueLine has choices instead of a plain continue.

interface DialogueChoice
src/shared/types/components.ts:269

Members

id

property
DialogueChoice.id: string

DialogueChoice.id runtime value.

nextLineId

property
DialogueChoice.nextLineId: string | null

Line to jump to when this choice is picked. Null ends the conversation.

text

property
DialogueChoice.text: string

DialogueChoice.text runtime value.

DialogueLine

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:277

Members

choices

property
DialogueLine.choices: DialogueChoice[]

Empty means clicking/continuing advances straight to nextLineId instead of showing choice buttons.

id

property
DialogueLine.id: string

DialogueLine.id runtime value.

nextLineId

property
DialogueLine.nextLineId: string | null

Used only when choices is empty. Null ends the conversation.

speaker

property
DialogueLine.speaker: string

Empty string hides the speaker label for this line.

text

property
DialogueLine.text: string

DialogueLine.text runtime value.

EngineComponent

EngineComponent scripting API.

type EngineComponent
src/shared/types/components.ts:514

Members

enabled

property
EngineComponent.enabled: boolean

EngineComponent.enabled runtime value.

type

property
EngineComponent.type: "Transform" | "SpriteRenderer" | "TextRenderer" | "Camera2D" | "Rigidbody2D" | "BoxCollider2D" | "CircleCollider2D" | "CapsuleCollider2D" | "PolygonCollider2D" | "EdgeCollider2D" | "CompositeCollider2D" | "TilemapCollider2D" | "Animator" | "AudioSource" | "Script" | "Tilemap" | "ParticleEmitter" | "ParallaxLayer" | "Light2D" | "UICanvas" | "Anchor" | "UIButton" | "UIHoverAnimation" | "UIPanel" | "DialogueBox"

EngineComponent.type runtime value.

Entity

Represents an object inside the active runtime scene.

class Entity
src/runtime/core/RuntimeEntity.ts:30

Members

active

property
Entity.active: boolean

Alias for {@link enabled}.

addChild

method
Entity.addChild(child: RuntimeEntity): void

Entity.addChild runtime operation.

addComponent

method
Entity.addComponent(component: EngineComponent): void

Adds a component and refreshes runtime systems. Script components may be added more than once.

addTag

method
Entity.addTag(tag: string): void

Adds a unique serializable tag.

children

property
Entity.children: RuntimeEntity[]

Direct child entities in serialized hierarchy order.

clone

method
Entity.clone(): RuntimeEntity

Clones this entity hierarchy into the active scene.

destroy

method
Entity.destroy(): void

Destroys this entity and all of its children.

enabled

property
Entity.enabled: boolean

Whether the entity is enabled in its scene.

events

property
Entity.events: OwnedEvents<Record<string, unknown>>

Local signal bus. Script listeners are automatically removed on destruction.

exists

property
Entity.exists: boolean

Whether this runtime entity still exists in the active scene.

getComponent

method
Entity.getComponent(type: "Animator"): RuntimeAnimator | undefined

Returns the first component of the requested type.

getComponents

method
Entity.getComponents<T extends ComponentType>(type: T): Extract<EngineComponent, { type: T; }>[]

Returns every matching component; omit type to return all components.

getVelocity

method
Entity.getVelocity(): SharedVector2

Returns the current Matter.js body velocity.

hasComponent

method
Entity.hasComponent(type: ComponentType): boolean

Returns whether an engine component is attached.

hasTag

method
Entity.hasTag(tag: string): boolean

Tests whether this entity contains a tag.

id

property
Entity.id: string

Entity.id runtime value.

instantiate

method
Entity.instantiate(template: EntityData | PrefabData, positionOrOptions?: Vector2Like | InstantiateOptions): RuntimeEntity

Creates an independent runtime copy of entity data or a complete prefab hierarchy.

layer

property
Entity.layer: string

Named gameplay/physics layer.

name

property
Entity.name: string

Display name serialized with the entity.

parent

property
Entity.parent: RuntimeEntity | null

Parent entity, or null for a scene root.

playAnimation

method
Entity.playAnimation(clipNameOrId: string): void

Starts an Animator clip by its name or ID without restarting an already-playing clip.

playAudio

method
Entity.playAudio(): void

Starts this entity's enabled AudioSource component.

removeChild

method
Entity.removeChild(child: RuntimeEntity): void

Entity.removeChild runtime operation.

removeComponent

method
Entity.removeComponent(type: ComponentType, componentId?: string): void

Removes components by type. Pass a script component ID to remove only that script instance.

removeTag

method
Entity.removeTag(tag: string): void

Removes a tag when present.

setActive

method
Entity.setActive(active: boolean): void

Enables or disables this entity.

setParent

method
Entity.setParent(parent: RuntimeEntity | null): void

Reparents this entity while preserving its local transform values.

setText

method
Entity.setText(value: string): void

Changes the first TextRenderer attached to this entity.

setVelocity

method
Entity.setVelocity(x: number, y: number): void

Sets the Matter.js body velocity.

stopAnimation

method
Entity.stopAnimation(): void

Stops the animation currently playing on this entity.

tags

property
Entity.tags: readonly string[]

Serializable gameplay tags attached to the entity.

teleport

method
Entity.teleport(x: number, y: number): void

Moves this entity immediately while keeping its physics body synchronized.

transform

property
Entity.transform: RuntimeTransform

Transform attached to this entity.

EntityData

EntityData scripting API.

interface EntityData
src/shared/types/scene.ts:3

Members

children

property
EntityData.children: string[]

EntityData.children runtime value.

components

property
EntityData.components: EngineComponent[]

EntityData.components runtime value.

enabled

property
EntityData.enabled: boolean

EntityData.enabled runtime value.

id

property
EntityData.id: string

EntityData.id runtime value.

layer

property
EntityData.layer: string | undefined

Physics, rendering, and query layer. Defaults to `Default`.

name

property
EntityData.name: string

EntityData.name runtime value.

parentId

property
EntityData.parentId: string | null

EntityData.parentId runtime value.

prefab

property
EntityData.prefab: { prefabId: string; sourceEntityId: string; } | undefined

EntityData.prefab runtime value.

tags

property
EntityData.tags: string[] | undefined

Gameplay classification. An entity may have any number of tags.

EventBus

Small signal bus used by global Events and per-entity signals.

class EventBus
src/runtime/events/Events.ts:8

Members

clear

method
EventBus.clear(): void

EventBus.clear runtime operation.

emit

method
EventBus.emit<K extends EventName<TEvents>>(name: K, ...args: EventArgs<TEvents, K>): void

EventBus.emit runtime operation.

off

method
EventBus.off<K extends EventName<TEvents>>(name: K, callback: Listener<TEvents[K]>): void

EventBus.off runtime operation.

on

method
EventBus.on<K extends EventName<TEvents>>(name: K, callback: Listener<TEvents[K]>, ownerId?: string): () => void

EventBus.on runtime operation.

removeOwner

method
EventBus.removeOwner(ownerId: string): void

EventBus.removeOwner runtime operation.

Events

Public global signal placeholder replaced by the active runtime bus in user modules.

EventsApi
src/runtime/events/Events.ts:73

Members

emit

method
Events.emit<K>(name: K, payload?: unknown): void

Invokes current listeners with an optional payload.

off

method
Events.off<K>(name: K, callback: Listener<unknown>): void

Removes matching listener registrations.

on

method
Events.on<K>(name: K, callback: Listener<unknown>): () => void

Registers a listener and returns an unsubscribe callback. Script-owned listeners are cleaned up automatically.

EventsApi

EventsApi scripting API.

type EventsApi
src/runtime/events/Events.ts:57

Members

emit

method
EventsApi.emit<K>(name: K, payload?: unknown): void

Invokes current listeners with an optional payload.

off

method
EventsApi.off<K>(name: K, callback: Listener<unknown>): void

Removes matching listener registrations.

on

method
EventsApi.on<K>(name: K, callback: Listener<unknown>): () => void

Registers a listener and returns an unsubscribe callback. Script-owned listeners are cleaned up automatically.

Game

Game scripting API.

class Game
src/runtime/Game.ts:10

Members

loadProject

method
Game.loadProject(source: string | ProjectData): Promise<void>

Game.loadProject runtime operation.

loadScene

method
Game.loadScene(nameOrId: string): Promise<void>

Game.loadScene runtime operation.

options

property
Game.options: GameOptions

Game.options runtime value.

start

method
Game.start(inputTarget?: HTMLElement): Promise<GameRuntime>

Game.start runtime operation.

stop

method
Game.stop(): void

Game.stop runtime operation.

GameEvents

Extend this interface through module augmentation to type global game events.

interface GameEvents
src/runtime/events/Events.ts:2
GameRuntime

GameRuntime scripting API.

class GameRuntime
src/runtime/GameRuntime.ts:32

Members

dispatchUIEvent

method
GameRuntime.dispatchUIEvent(entityId: string, type: "click" | "pointerenter" | "pointerexit" | "focus" | "blur"): void

Forwards a Button interaction from the renderer to scripts and any active dialogue choice buttons.

getScene

method
GameRuntime.getScene(): SceneData

GameRuntime.getScene runtime operation.

loadScene

method
GameRuntime.loadScene(nameOrId: string): void

GameRuntime.loadScene runtime operation.

pause

method
GameRuntime.pause(): void

GameRuntime.pause runtime operation.

resume

method
GameRuntime.resume(): void

GameRuntime.resume runtime operation.

setTouchControlsPreview

method
GameRuntime.setTouchControlsPreview(visible: boolean): void

Force-shows or hides the on-screen touch controls, for editors previewing mobile layout on a desktop pointer.

start

method
GameRuntime.start(inputTarget: HTMLElement): Promise<void>

Loads persisted save data, then boots the first scene. Await this before assuming Save.get returns saved values.

stop

method
GameRuntime.stop(): void

GameRuntime.stop runtime operation.

GridCell

GridCell scripting API.

interface GridCell
src/engine/navigation/GridPathfinding.ts:1

Members

x

property
GridCell.x: number

GridCell.x runtime value.

y

property
GridCell.y: number

GridCell.y runtime value.

instantiate

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:95
InstantiateOptions

InstantiateOptions scripting API.

interface InstantiateOptions
src/runtime/core/RuntimeEntity.ts:10

Members

parent

property
InstantiateOptions.parent: RuntimeEntity | null | undefined

InstantiateOptions.parent runtime value.

position

property
InstantiateOptions.position: Vector2Like | undefined

InstantiateOptions.position runtime value.

rotation

property
InstantiateOptions.rotation: number | undefined

InstantiateOptions.rotation runtime value.

Math2D

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

Members

approximately

method
Math2D.approximately(a: number, b: number, epsilon?: number): boolean

Compares floating-point values with a relative tolerance.

clamp

method
Math2D.clamp(value: number, min: number, max: number): number

Constrains a scalar to an inclusive range.

degToRad

method
Math2D.degToRad(degrees: number): number

Converts degrees to radians.

inverseLerp

method
Math2D.inverseLerp(a: number, b: number, value: number): number

Returns the interpolation factor of value between a and b.

lerp

method
Math2D.lerp(a: number, b: number, t: number): number

Linearly interpolates without clamping t.

moveTowards

method
Math2D.moveTowards(current: number, target: number, maxDelta: number): number

Moves a scalar toward a target by no more than maxDelta.

pingPong

method
Math2D.pingPong(value: number, length: number): number

Oscillates a value between zero and length.

radToDeg

method
Math2D.radToDeg(radians: number): number

Converts radians to degrees.

repeat

method
Math2D.repeat(value: number, length: number): number

Wraps a value into the range 0..length.

Navigation

Tilemap A* pathfinding. The runtime supplies the active scene implementation to user scripts.

NavigationApi
src/runtime/scripting/publicApi.ts:84

Members

cellToWorld

method
Navigation.cellToWorld(tilemapEntity: RuntimeEntity, cell: GridCell): Vector2

Navigation.cellToWorld runtime operation.

findPath

method
Navigation.findPath(tilemapEntity: RuntimeEntity, startWorld: Vector2Like, goalWorld: Vector2Like, options?: NavigationPathOptions): Vector2[]

Finds an A* path across a Tilemap and returns world-space cell centers.

isWalkable

method
Navigation.isWalkable(tilemapEntity: RuntimeEntity, worldPosition: Vector2Like, options?: NavigationPathOptions): boolean

Returns whether one world position is inside a non-collision tilemap cell.

worldToCell

method
Navigation.worldToCell(tilemapEntity: RuntimeEntity, worldPosition: Vector2Like): GridCell

Navigation.worldToCell runtime operation.

NavigationApi

NavigationApi scripting API.

interface NavigationApi
src/runtime/navigation/Navigation.ts:13

Members

cellToWorld

method
NavigationApi.cellToWorld(tilemapEntity: RuntimeEntity, cell: GridCell): Vector2

NavigationApi.cellToWorld runtime operation.

findPath

method
NavigationApi.findPath(tilemapEntity: RuntimeEntity, startWorld: Vector2Like, goalWorld: Vector2Like, options?: NavigationPathOptions): Vector2[]

Finds an A* path across a Tilemap and returns world-space cell centers.

isWalkable

method
NavigationApi.isWalkable(tilemapEntity: RuntimeEntity, worldPosition: Vector2Like, options?: NavigationPathOptions): boolean

Returns whether one world position is inside a non-collision tilemap cell.

worldToCell

method
NavigationApi.worldToCell(tilemapEntity: RuntimeEntity, worldPosition: Vector2Like): GridCell

NavigationApi.worldToCell runtime operation.

NavigationPathOptions

NavigationPathOptions scripting API.

interface NavigationPathOptions
src/runtime/navigation/Navigation.ts:6

Members

allowDiagonal

property
NavigationPathOptions.allowDiagonal: boolean | undefined

NavigationPathOptions.allowDiagonal runtime value.

collisionLayerIds

property
NavigationPathOptions.collisionLayerIds: string[] | undefined

Collision layer IDs used as blocked cells. Empty uses layers whose collision flag is enabled.

maxVisited

property
NavigationPathOptions.maxVisited: number | undefined

NavigationPathOptions.maxVisited runtime value.

OwnedEvents

OwnedEvents scripting API.

interface OwnedEvents
src/runtime/events/Events.ts:42

Members

emit

method
OwnedEvents.emit<K extends EventName<TEvents>>(name: K, ...args: EventArgs<TEvents, K>): void

Invokes current listeners with an optional payload.

off

method
OwnedEvents.off<K extends EventName<TEvents>>(name: K, callback: Listener<TEvents[K]>): void

Removes matching listener registrations.

on

method
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.

ProjectData

ProjectData scripting API.

interface ProjectData
src/shared/types/project.ts:93

Members

activeSceneId

property
ProjectData.activeSceneId: string

ProjectData.activeSceneId runtime value.

animations

property
ProjectData.animations: AnimationClip[]

ProjectData.animations runtime value.

animatorControllers

property
ProjectData.animatorControllers: AnimatorController[]

ProjectData.animatorControllers runtime value.

assetFolders

property
ProjectData.assetFolders: AssetFolder[] | undefined

Virtual folders shown in the Asset Browser. Optional for backwards-compatible project files.

assets

property
ProjectData.assets: AssetData[]

ProjectData.assets runtime value.

id

property
ProjectData.id: string

ProjectData.id runtime value.

input

property
ProjectData.input: InputConfiguration

ProjectData.input runtime value.

name

property
ProjectData.name: string

ProjectData.name runtime value.

prefabs

property
ProjectData.prefabs: PrefabData[]

ProjectData.prefabs runtime value.

scenes

property
ProjectData.scenes: SceneData[]

ProjectData.scenes runtime value.

schemaVersion

property
ProjectData.schemaVersion: 1

ProjectData.schemaVersion runtime value.

settings

property
ProjectData.settings: ProjectSettings

ProjectData.settings runtime value.

property

Marks a script field as editable through the Inspector.

property(options?: PropertyOptions): PropertyDecorator
src/runtime/scripting/property.ts:15
PropertyOptions

PropertyOptions scripting API.

interface PropertyOptions
src/runtime/scripting/property.ts:3

Members

label

property
PropertyOptions.label: string | undefined

PropertyOptions.label runtime value.

max

property
PropertyOptions.max: number | undefined

PropertyOptions.max runtime value.

min

property
PropertyOptions.min: number | undefined

PropertyOptions.min runtime value.

options

property
PropertyOptions.options: string[] | undefined

PropertyOptions.options runtime value.

step

property
PropertyOptions.step: number | undefined

PropertyOptions.step runtime value.

type

property
PropertyOptions.type: ScriptPropertyKind | undefined

PropertyOptions.type runtime value.

RuntimeEntity

Represents an object inside the active runtime scene.

class RuntimeEntity
src/runtime/core/RuntimeEntity.ts:30

Members

active

property
RuntimeEntity.active: boolean

Alias for {@link enabled}.

addChild

method
RuntimeEntity.addChild(child: RuntimeEntity): void

RuntimeEntity.addChild runtime operation.

addComponent

method
RuntimeEntity.addComponent(component: EngineComponent): void

Adds a component and refreshes runtime systems. Script components may be added more than once.

addTag

method
RuntimeEntity.addTag(tag: string): void

Adds a unique serializable tag.

children

property
RuntimeEntity.children: RuntimeEntity[]

Direct child entities in serialized hierarchy order.

clone

method
RuntimeEntity.clone(): RuntimeEntity

Clones this entity hierarchy into the active scene.

destroy

method
RuntimeEntity.destroy(): void

Destroys this entity and all of its children.

enabled

property
RuntimeEntity.enabled: boolean

Whether the entity is enabled in its scene.

events

property
RuntimeEntity.events: OwnedEvents<Record<string, unknown>>

Local signal bus. Script listeners are automatically removed on destruction.

exists

property
RuntimeEntity.exists: boolean

Whether this runtime entity still exists in the active scene.

getComponent

method
RuntimeEntity.getComponent(type: "Animator"): RuntimeAnimator | undefined

Returns the first component of the requested type.

getComponents

method
RuntimeEntity.getComponents<T extends ComponentType>(type: T): Extract<EngineComponent, { type: T; }>[]

Returns every matching component; omit type to return all components.

getVelocity

method
RuntimeEntity.getVelocity(): SharedVector2

Returns the current Matter.js body velocity.

hasComponent

method
RuntimeEntity.hasComponent(type: ComponentType): boolean

Returns whether an engine component is attached.

hasTag

method
RuntimeEntity.hasTag(tag: string): boolean

Tests whether this entity contains a tag.

id

property
RuntimeEntity.id: string

RuntimeEntity.id runtime value.

instantiate

method
RuntimeEntity.instantiate(template: EntityData | PrefabData, positionOrOptions?: Vector2Like | InstantiateOptions): RuntimeEntity

Creates an independent runtime copy of entity data or a complete prefab hierarchy.

layer

property
RuntimeEntity.layer: string

Named gameplay/physics layer.

name

property
RuntimeEntity.name: string

Display name serialized with the entity.

parent

property
RuntimeEntity.parent: RuntimeEntity | null

Parent entity, or null for a scene root.

playAnimation

method
RuntimeEntity.playAnimation(clipNameOrId: string): void

Starts an Animator clip by its name or ID without restarting an already-playing clip.

playAudio

method
RuntimeEntity.playAudio(): void

Starts this entity's enabled AudioSource component.

removeChild

method
RuntimeEntity.removeChild(child: RuntimeEntity): void

RuntimeEntity.removeChild runtime operation.

removeComponent

method
RuntimeEntity.removeComponent(type: ComponentType, componentId?: string): void

Removes components by type. Pass a script component ID to remove only that script instance.

removeTag

method
RuntimeEntity.removeTag(tag: string): void

Removes a tag when present.

setActive

method
RuntimeEntity.setActive(active: boolean): void

Enables or disables this entity.

setParent

method
RuntimeEntity.setParent(parent: RuntimeEntity | null): void

Reparents this entity while preserving its local transform values.

setText

method
RuntimeEntity.setText(value: string): void

Changes the first TextRenderer attached to this entity.

setVelocity

method
RuntimeEntity.setVelocity(x: number, y: number): void

Sets the Matter.js body velocity.

stopAnimation

method
RuntimeEntity.stopAnimation(): void

Stops the animation currently playing on this entity.

tags

property
RuntimeEntity.tags: readonly string[]

Serializable gameplay tags attached to the entity.

teleport

method
RuntimeEntity.teleport(x: number, y: number): void

Moves this entity immediately while keeping its physics body synchronized.

transform

property
RuntimeEntity.transform: RuntimeTransform

Transform attached to this entity.

RuntimeTransform

Live transform view for a runtime entity. Rotation is always measured clockwise in degrees.

class RuntimeTransform
src/runtime/core/RuntimeTransform.ts:7

Members

localPosition

property
RuntimeTransform.localPosition: Vector2

RuntimeTransform.localPosition runtime value.

localRotation

property
RuntimeTransform.localRotation: number

RuntimeTransform.localRotation runtime value.

localScale

property
RuntimeTransform.localScale: Vector2

RuntimeTransform.localScale runtime value.

localToWorld

method
RuntimeTransform.localToWorld(point: Vector2Like): Vector2

RuntimeTransform.localToWorld runtime operation.

lookAt

method
RuntimeTransform.lookAt(worldTarget: Vector2Like): void

RuntimeTransform.lookAt runtime operation.

parent

property
RuntimeTransform.parent: RuntimeTransform | null

RuntimeTransform.parent runtime value.

position

property
RuntimeTransform.position: Vector2

World position. Setting it converts through the parent transform.

rotate

method
RuntimeTransform.rotate(degrees: number): void

RuntimeTransform.rotate runtime operation.

rotation

property
RuntimeTransform.rotation: number

RuntimeTransform.rotation runtime value.

scale

property
RuntimeTransform.scale: Vector2

RuntimeTransform.scale runtime value.

translate

method
RuntimeTransform.translate(offset: Vector2Like, local?: boolean): void

RuntimeTransform.translate runtime operation.

worldToLocal

method
RuntimeTransform.worldToLocal(point: Vector2Like): Vector2

RuntimeTransform.worldToLocal runtime operation.

Script

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:115

Members

awake

method
Script.awake(): void

Called once immediately after the script is created and bound.

entity

property
Script.entity: RuntimeEntity

Script.entity runtime value.

events

property
Script.events: OwnedEvents<Record<string, unknown>>

Script-owned global listeners are removed automatically during onDestroy.

fixedUpdate

method
Script.fixedUpdate(delta: number): void

Called at a fixed timestep before each physics step.

game

property
Script.game: RuntimeGameContext

Pause and resume controls for the current game runtime.

input

property
Script.input: InputReader

Input actions configured by the current project.

onAnimationEvent

method
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.

onCollisionEnter

method
Script.onCollisionEnter(event: CollisionEvent2D): void

Called on the first physics step that touches another non-trigger collider.

onCollisionExit

method
Script.onCollisionExit(event: CollisionEvent2D): void

Called after contact with another non-trigger collider ends.

onCollisionStay

method
Script.onCollisionStay(event: CollisionEvent2D): void

Called on physics steps while touching another non-trigger collider.

onDestroy

method
Script.onDestroy(): void

Called once immediately before the script instance is discarded.

onDisable

method
Script.onDisable(): void

Called when the script transitions from enabled to disabled.

onEnable

method
Script.onEnable(): void

Called whenever the script transitions from disabled to enabled.

onTriggerEnter

method
Script.onTriggerEnter(event: TriggerEvent2D): void

Called on the first physics step that overlaps a trigger collider.

onTriggerExit

method
Script.onTriggerExit(event: TriggerEvent2D): void

Called after overlap with a trigger collider ends.

onTriggerStay

method
Script.onTriggerStay(event: TriggerEvent2D): void

Called on physics steps while overlapping a trigger collider.

sceneManager

property
Script.sceneManager: RuntimeSceneManager

Scene loading API for the current game.

start

method
Script.start(): void

Called once before the first update, after the first onEnable call.

timer

property
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.

transform

property
Script.transform: RuntimeTransform

Shortcut for `entity.transform`.

update

method
Script.update(delta: number): void

Called once per rendered frame while the script is enabled.

TextRenderer

Mutable text component used by HUD, menus, labels, and dialog. Component token for dynamic text rendered by PixiJS.

"TextRenderer"
src/runtime/index.ts:134
Time

Public clock placeholder replaced with the active game's clock in user modules.

TimeApi
src/runtime/time/Time.ts:42

Members

deltaTime

property
Time.deltaTime: number

Scaled duration of the current frame in seconds.

elapsed

property
Time.elapsed: number

Total scaled runtime duration.

fixedDeltaTime

property
Time.fixedDeltaTime: number

Fixed physics timestep in seconds.

frameCount

property
Time.frameCount: number

Number of rendered runtime frames.

timeScale

property
Time.timeScale: number

Global gameplay speed. Set to zero to pause scaled gameplay.

unscaledDeltaTime

property
Time.unscaledDeltaTime: number

Real duration of the current frame, unaffected by timeScale.

unscaledElapsed

property
Time.unscaledElapsed: number

Total real runtime duration.

TimeApi

Public runtime clock. Durations are expressed in seconds; scaled values honor {@link timeScale}.

interface TimeApi
src/runtime/time/Time.ts:2

Members

deltaTime

property
TimeApi.deltaTime: number

Scaled duration of the current frame in seconds.

elapsed

property
TimeApi.elapsed: number

Total scaled runtime duration.

fixedDeltaTime

property
TimeApi.fixedDeltaTime: number

Fixed physics timestep in seconds.

frameCount

property
TimeApi.frameCount: number

Number of rendered runtime frames.

timeScale

property
TimeApi.timeScale: number

Global gameplay speed. Set to zero to pause scaled gameplay.

unscaledDeltaTime

property
TimeApi.unscaledDeltaTime: number

Real duration of the current frame, unaffected by timeScale.

unscaledElapsed

property
TimeApi.unscaledElapsed: number

Total real runtime duration.

Timer

Public timer placeholder replaced with the active game's scheduler in user modules.

TimerApi
src/runtime/time/Timer.ts:69

Members

after

method
Timer.after(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle

Runs callback once after a duration. Uses scaled time unless `unscaled` is true.

cancel

method
Timer.cancel(handle: TimerHandle): void

Permanently cancels a timer handle.

every

method
Timer.every(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle

Repeats callback at an interval. Uses scaled time unless `unscaled` is true.

pause

method
Timer.pause(handle: TimerHandle): void

Suspends a timer without resetting its remaining duration.

resume

method
Timer.resume(handle: TimerHandle): void

Continues a paused timer.

TimerApi

TimerApi scripting API.

interface TimerApi
src/runtime/time/Timer.ts:3

Members

after

method
TimerApi.after(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle

Runs callback once after a duration. Uses scaled time unless `unscaled` is true.

cancel

method
TimerApi.cancel(handle: TimerHandle): void

Permanently cancels a timer handle.

every

method
TimerApi.every(seconds: number, callback: () => void, options?: TimerOptions): TimerHandle

Repeats callback at an interval. Uses scaled time unless `unscaled` is true.

pause

method
TimerApi.pause(handle: TimerHandle): void

Suspends a timer without resetting its remaining duration.

resume

method
TimerApi.resume(handle: TimerHandle): void

Continues a paused timer.

TimerHandle

TimerHandle scripting API.

interface TimerHandle
src/runtime/time/Timer.ts:1

Members

id

property
TimerHandle.id: number

TimerHandle.id runtime value.

TimerOptions

TimerOptions scripting API.

interface TimerOptions
src/runtime/time/Timer.ts:2

Members

unscaled

property
TimerOptions.unscaled: boolean | undefined

TimerOptions.unscaled runtime value.

TouchControl

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:39
Transform

Stores local position, rotation, and scale for every entity.

interface Transform
src/shared/types/components.ts:39

Members

enabled

property
Transform.enabled: boolean

Transform.enabled runtime value.

position

property
Transform.position: Vector2

Local position relative to the parent entity.

rotation

property
Transform.rotation: number

Local clockwise rotation in degrees.

scale

property
Transform.scale: Vector2

Local horizontal and vertical scale.

type

property
Transform.type: "Transform"

Transform.type runtime value.

TriggerEvent2D

Detailed trigger overlap callback data. Extends the other collider for backward compatibility.

class TriggerEvent2D
src/runtime/scripting/PhysicsEvents2D.ts:20

Members

component

property
TriggerEvent2D.component: Collider2DComponent

TriggerEvent2D.component runtime value.

containsPoint

method
TriggerEvent2D.containsPoint(point: Vector2Like): boolean

Tests a world-space point against this collider's exact engine shape.

enabled

property
TriggerEvent2D.enabled: boolean

TriggerEvent2D.enabled runtime value.

entity

property
TriggerEvent2D.entity: RuntimeEntity

TriggerEvent2D.entity runtime value.

getBounds

method
TriggerEvent2D.getBounds(): Bounds2D

Returns a world-axis-aligned bounding box.

getClosestPoint

method
TriggerEvent2D.getClosestPoint(point: Vector2Like): Vector2

Returns the closest point on or inside the collider in world space.

id

property
TriggerEvent2D.id: string

TriggerEvent2D.id runtime value.

isTrigger

property
TriggerEvent2D.isTrigger: boolean

TriggerEvent2D.isTrigger runtime value.

layer

property
TriggerEvent2D.layer: string

Collider filtering uses its owning entity's project layer.

material

property
TriggerEvent2D.material: PhysicsMaterial2D | null

Physics material asset ID. Material assets are introduced in Collider Phase 2.

name

property
TriggerEvent2D.name: string

TriggerEvent2D.name runtime value.

offset

property
TriggerEvent2D.offset: Vector2

TriggerEvent2D.offset runtime value.

oneWay

property
TriggerEvent2D.oneWay: boolean

TriggerEvent2D.oneWay runtime value.

oneWayDirection

property
TriggerEvent2D.oneWayDirection: Vector2

Local direction of the solid face for one-way collision handling.

oneWayTolerance

property
TriggerEvent2D.oneWayTolerance: number

Positional tolerance in world units used near a one-way surface.

otherCollider

property
TriggerEvent2D.otherCollider: Collider2D

TriggerEvent2D.otherCollider runtime value.

otherEntity

property
TriggerEvent2D.otherEntity: RuntimeEntity

TriggerEvent2D.otherEntity runtime value.

selfCollider

property
TriggerEvent2D.selfCollider: Collider2D

TriggerEvent2D.selfCollider runtime value.

UIButton

A clickable UI element with configurable animated interaction feedback.

"UIButton"
src/runtime/index.ts:137
UICanvas

Marks the root of a screen-space UI hierarchy (a HUD, menu, or dialog).

"UICanvas"
src/runtime/index.ts:135
UIPanel

A non-visual layout container that arranges Anchor'd children in a row or column.

"UIPanel"
src/runtime/index.ts:139
Vector2

Mutable two-dimensional vector used by the public scripting API.

class Vector2
src/runtime/math/Vector2.ts:4

Members

add

method
Vector2.add(value: Vector2Like): Vector2

Adds a vector in place.

clone

method
Vector2.clone(): Vector2

Returns an independent copy.

divide

method
Vector2.divide(value: number | Vector2Like): Vector2

Divides by a scalar or component-wise vector in place. Zero divisors produce zero.

equals

method
Vector2.equals(other: Vector2Like, epsilon?: number): boolean

Compares components within an optional epsilon.

length

property
Vector2.length: number

Vector2.length runtime value.

lengthSquared

property
Vector2.lengthSquared: number

Vector2.lengthSquared runtime value.

multiply

method
Vector2.multiply(value: number | Vector2Like): Vector2

Multiplies by a scalar or component-wise vector in place.

normalize

method
Vector2.normalize(): Vector2

Normalizes this vector in place.

normalized

property
Vector2.normalized: Vector2

Vector2.normalized runtime value.

set

method
Vector2.set(x: number, y: number): Vector2

Vector2.set runtime operation.

subtract

method
Vector2.subtract(value: Vector2Like): Vector2

Subtracts a vector in place.

toJSON

method
Vector2.toJSON(): Vector2Like

Vector2.toJSON runtime operation.

x

property
Vector2.x: number

Vector2.x runtime value.

y

property
Vector2.y: number

Vector2.y runtime value.

Vector2Like

Vector2Like scripting API.

interface Vector2Like
src/runtime/math/Vector2.ts:1

Members

x

property
Vector2Like.x: number

Vector2Like.x runtime value.

y

property
Vector2Like.y: number

Vector2Like.y runtime value.

PrefabData

PrefabData scripting API.

interface PrefabData
src/shared/types/prefab.ts:3

Members

entities

property
PrefabData.entities: EntityData[]

PrefabData.entities runtime value.

id

property
PrefabData.id: string

PrefabData.id runtime value.

name

property
PrefabData.name: string

PrefabData.name runtime value.

rootEntityId

property
PrefabData.rootEntityId: string

PrefabData.rootEntityId runtime value.

schemaVersion

property
PrefabData.schemaVersion: 1

PrefabData.schemaVersion runtime value.

Scene

Public placeholder replaced with queries for the active runtime scene in user modules.

SceneQuery
src/runtime/scene/SceneQuery.ts:36

Members

findAllByTag

method
Scene.findAllByTag(tag: string, options?: SceneQueryOptions): RuntimeEntity[]

Returns all entities carrying a tag, optionally filtered by layer.

findAllWithComponent

method
Scene.findAllWithComponent<T>(type: ComponentQuery<T>, options?: SceneQueryOptions): RuntimeEntity[]

Returns all entities with an engine component token or user Script class.

findById

method
Scene.findById(id: string): RuntimeEntity | null

Finds an entity by its stable serialized ID.

findByName

method
Scene.findByName(name: string): RuntimeEntity | null

Finds the first enabled or disabled entity with an exact display name.

findByTag

method
Scene.findByTag(tag: string, options?: SceneQueryOptions): RuntimeEntity | null

Finds the first entity carrying a tag. Cache this result instead of querying every update.

findWithComponent

method
Scene.findWithComponent<T>(type: ComponentQuery<T>, options?: SceneQueryOptions): RuntimeEntity | null

Finds the first entity with an engine component token or user Script class.

SceneData

SceneData scripting API.

interface SceneData
src/shared/types/scene.ts:27

Members

entities

property
SceneData.entities: EntityData[]

SceneData.entities runtime value.

id

property
SceneData.id: string

SceneData.id runtime value.

name

property
SceneData.name: string

SceneData.name runtime value.

rootEntityIds

property
SceneData.rootEntityIds: string[]

SceneData.rootEntityIds runtime value.

schemaVersion

property
SceneData.schemaVersion: 1

SceneData.schemaVersion runtime value.

settings

property
SceneData.settings: SceneSettings | undefined

SceneData.settings runtime value.

SceneManager

Loads and inspects scenes in the active game runtime.

RuntimeSceneManager
src/runtime/scripting/publicApi.ts:39

Members

getActiveScene

method
SceneManager.getActiveScene(): SceneData

Returns the active mutable runtime scene.

loadScene

method
SceneManager.loadScene(nameOrId: string): void

Queues a scene by name or ID for loading before the next frame.

reloadScene

method
SceneManager.reloadScene(): void

Reloads the active scene from its serialized project data.

SceneQuery

Convenience queries over the active scene. Cache results instead of repeating broad queries every update.

class SceneQuery
src/runtime/scene/SceneQuery.ts:10

Members

findAllByTag

method
SceneQuery.findAllByTag(tag: string, options?: SceneQueryOptions): RuntimeEntity[]

Returns all entities carrying a tag, optionally filtered by layer.

findAllWithComponent

method
SceneQuery.findAllWithComponent<T>(type: ComponentQuery<T>, options?: SceneQueryOptions): RuntimeEntity[]

Returns all entities with an engine component token or user Script class.

findById

method
SceneQuery.findById(id: string): RuntimeEntity | null

Finds an entity by its stable serialized ID.

findByName

method
SceneQuery.findByName(name: string): RuntimeEntity | null

Finds the first enabled or disabled entity with an exact display name.

findByTag

method
SceneQuery.findByTag(tag: string, options?: SceneQueryOptions): RuntimeEntity | null

Finds the first entity carrying a tag. Cache this result instead of querying every update.

findWithComponent

method
SceneQuery.findWithComponent<T>(type: ComponentQuery<T>, options?: SceneQueryOptions): RuntimeEntity | null

Finds the first entity with an engine component token or user Script class.

SceneQueryOptions

SceneQueryOptions scripting API.

interface SceneQueryOptions
src/runtime/scene/SceneQuery.ts:5

Members

layerMask

property
SceneQueryOptions.layerMask: LayerMask | undefined

SceneQueryOptions.layerMask runtime value.

Input

Reads project input actions. The runtime supplies the active implementation to user scripts.

InputApi
src/runtime/scripting/publicApi.ts:16

Members

gamepadConnected

method
Input.gamepadConnected(index: number): boolean

Returns whether a browser gamepad slot is connected.

getAxis

method
Input.getAxis(actionName: string): number

Returns a configured/conventional axis, or -1..1 from a negative/positive action pair.

getGamepadAxis

method
Input.getGamepadAxis(index: number, axis: number): number

Reads a gamepad axis in the range -1 through 1.

getGamepadButton

method
Input.getGamepadButton(index: number, button: number): boolean

Returns whether a gamepad button is currently pressed.

getGamepadButtonDown

method
Input.getGamepadButtonDown(index: number, button: number): boolean

Input.getGamepadButtonDown runtime operation.

getGamepadButtonUp

method
Input.getGamepadButtonUp(index: number, button: number): boolean

Input.getGamepadButtonUp runtime operation.

isJustPressed

method
Input.isJustPressed(actionName: string): boolean

Returns true only on the frame an input action begins.

isJustReleased

method
Input.isJustReleased(actionName: string): boolean

Returns true only on the frame an input action ends.

isPressed

method
Input.isPressed(actionName: string): boolean

Returns true while an input action is held.

mouseButton

method
Input.mouseButton(button: number): boolean

Returns true while a zero-based mouse button is held.

mouseButtonDown

method
Input.mouseButtonDown(button: number): boolean

Returns true only on the frame a mouse button is pressed.

mouseButtonUp

method
Input.mouseButtonUp(button: number): boolean

Returns true only on the frame a mouse button is released.

mousePosition

property
Input.mousePosition: SharedVector2

Pointer position relative to the game viewport in screen pixels.

mouseWorldPosition

property
Input.mouseWorldPosition: SharedVector2

Pointer position converted through the primary runtime camera.

touchControl

method
Input.touchControl(control: TouchControl): boolean

Reads one semantic virtual-stick or mobile action control.

touches

property
Input.touches: readonly SharedVector2[]

Active touch positions relative to the game viewport.

touchStick

property
Input.touchStick: SharedVector2

Current virtual analog stick drag, each axis in -1..1. Zero when no stick touch is active.

InputBinding

InputBinding scripting API.

type InputBinding
src/shared/types/project.ts:31

Members

kind

property
InputBinding.kind: "key" | "mouse" | "gamepad-button" | "gamepad-axis" | "touch"

InputBinding.kind runtime value.

InputConfiguration

InputConfiguration scripting API.

interface InputConfiguration
src/shared/types/project.ts:85

Members

actions

property
InputConfiguration.actions: InputActionDefinition[]

InputConfiguration.actions runtime value.

deviceBindingsVersion

property
InputConfiguration.deviceBindingsVersion: 1 | undefined

Migration marker so user-removed gamepad/touch bindings are not recreated on every load.

touchControls

property
InputConfiguration.touchControls: TouchControlsSettings | undefined

On-screen virtual stick/button layout for touch devices. Filled in with defaults by withDefaultDeviceBindings when absent.

BoxCollider2D

Best for walls, platforms, boxes, and simple rectangular props.

"BoxCollider2D"
src/runtime/index.ts:116
CapsuleCollider2D

Best for player characters, NPCs, and enemies.

"CapsuleCollider2D"
src/runtime/index.ts:120
CapsuleQueryOptions

CapsuleQueryOptions scripting API.

interface CapsuleQueryOptions
src/runtime/physics/Physics2D.ts:10

Members

direction

property
CapsuleQueryOptions.direction: "vertical" | "horizontal" | undefined

CapsuleQueryOptions.direction runtime value.

includeTriggers

property
CapsuleQueryOptions.includeTriggers: boolean | undefined

CapsuleQueryOptions.includeTriggers runtime value.

layerMask

property
CapsuleQueryOptions.layerMask: LayerMask | undefined

CapsuleQueryOptions.layerMask runtime value.

rotation

property
CapsuleQueryOptions.rotation: number | undefined

CapsuleQueryOptions.rotation runtime value.

CircleCollider2D

Best for balls, circular objects, and inexpensive detection areas.

"CircleCollider2D"
src/runtime/index.ts:118
Collider2D

Backend-independent collider view used by scripts, queries, and physics callbacks.

class Collider2D
src/runtime/scripting/Collider2D.ts:13

Members

component

property
Collider2D.component: Collider2DComponent

Collider2D.component runtime value.

containsPoint

method
Collider2D.containsPoint(point: Vector2Like): boolean

Tests a world-space point against this collider's exact engine shape.

enabled

property
Collider2D.enabled: boolean

Collider2D.enabled runtime value.

entity

property
Collider2D.entity: RuntimeEntity

Collider2D.entity runtime value.

getBounds

method
Collider2D.getBounds(): Bounds2D

Returns a world-axis-aligned bounding box.

getClosestPoint

method
Collider2D.getClosestPoint(point: Vector2Like): Vector2

Returns the closest point on or inside the collider in world space.

id

property
Collider2D.id: string

Collider2D.id runtime value.

isTrigger

property
Collider2D.isTrigger: boolean

Collider2D.isTrigger runtime value.

layer

property
Collider2D.layer: string

Collider filtering uses its owning entity's project layer.

material

property
Collider2D.material: PhysicsMaterial2D | null

Physics material asset ID. Material assets are introduced in Collider Phase 2.

name

property
Collider2D.name: string

Collider2D.name runtime value.

offset

property
Collider2D.offset: Vector2

Collider2D.offset runtime value.

oneWay

property
Collider2D.oneWay: boolean

Collider2D.oneWay runtime value.

oneWayDirection

property
Collider2D.oneWayDirection: Vector2

Local direction of the solid face for one-way collision handling.

oneWayTolerance

property
Collider2D.oneWayTolerance: number

Positional tolerance in world units used near a one-way surface.

CompositeCollider2D

Combines several simple shapes under one collider identity.

"CompositeCollider2D"
src/runtime/index.ts:126
CompositeColliderShape2D

CompositeColliderShape2D scripting API.

type CompositeColliderShape2D
src/shared/types/components.ts:417

Members

enabled

property
CompositeColliderShape2D.enabled: boolean

CompositeColliderShape2D.enabled runtime value.

id

property
CompositeColliderShape2D.id: string

CompositeColliderShape2D.id runtime value.

name

property
CompositeColliderShape2D.name: string

CompositeColliderShape2D.name runtime value.

offset

property
CompositeColliderShape2D.offset: Vector2

CompositeColliderShape2D.offset runtime value.

rotation

property
CompositeColliderShape2D.rotation: number

Clockwise local rotation in degrees.

type

property
CompositeColliderShape2D.type: "box" | "circle" | "capsule" | "polygon"

CompositeColliderShape2D.type runtime value.

EdgeCollider2D

Best for terrain surfaces, ground contours, and open level boundaries.

"EdgeCollider2D"
src/runtime/index.ts:124
LayerMask

Immutable collection of entity layer names used by physics and scene queries.

class LayerMask
src/runtime/physics/LayerMask.ts:2

Members

includes

method
LayerMask.includes(layer: string): boolean

Returns whether the mask contains a layer.

toArray

method
LayerMask.toArray(): string[]

LayerMask.toArray runtime operation.

Physics2D

Public placeholder replaced with the active runtime physics query API in user modules.

Physics2DApi
src/runtime/physics/Physics2D.ts:66

Members

boxCast

method
Physics2D.boxCast(origin: Vector2Like, size: Vector2Like, direction: Vector2Like, options?: ShapeCastOptions): RaycastHit2D | null

Sweeps a box using the backend's conservative native-width query.

capsuleCast

method
Physics2D.capsuleCast(origin: Vector2Like, size: Vector2Like, direction: Vector2Like, options?: ShapeCastOptions): RaycastHit2D | null

Sweeps a capsule using its minor axis as the query width.

circleCast

method
Physics2D.circleCast(origin: Vector2Like, radius: number, direction: Vector2Like, options?: ShapeCastOptions): RaycastHit2D | null

Sweeps a circle and returns the nearest collider hit.

linecast

method
Physics2D.linecast(start: Vector2Like, end: Vector2Like, options?: PhysicsQueryOptions): RaycastHit2D | null

Casts a zero-width segment from start to end.

overlapBox

method
Physics2D.overlapBox(center: Vector2Like, size: Vector2Like, options?: PhysicsQueryOptions & { rotation?: number; }): Collider2D[]

Physics2D.overlapBox runtime operation.

overlapCapsule

method
Physics2D.overlapCapsule(center: Vector2Like, size: Vector2Like, options?: CapsuleQueryOptions): Collider2D[]

Returns colliders overlapping a capsule probe.

overlapCircle

method
Physics2D.overlapCircle(center: Vector2Like, radius: number, options?: PhysicsQueryOptions): Collider2D[]

Returns colliders overlapping a world-space circle.

overlapPoint

method
Physics2D.overlapPoint(point: Vector2Like, options?: PhysicsQueryOptions): Collider2D[]

Returns colliders containing a world-space point.

raycast

method
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.

raycastAll

method
Physics2D.raycastAll(origin: Vector2Like, direction: Vector2Like, options?: RaycastOptions): RaycastHit2D[]

Casts a ray and returns every matching hit sorted nearest-first.

PhysicsMaterial2D

Reusable backend-independent material applied to Collider2D shapes.

interface PhysicsMaterial2D
src/shared/types/assets.ts:82

Members

bounciness

property
PhysicsMaterial2D.bounciness: number

Elasticity in the range 0..1.

density

property
PhysicsMaterial2D.density: number

Mass per unit area. Must be greater than zero.

friction

property
PhysicsMaterial2D.friction: number

Surface resistance in the range 0..1.

id

property
PhysicsMaterial2D.id: string

PhysicsMaterial2D.id runtime value.

name

property
PhysicsMaterial2D.name: string

PhysicsMaterial2D.name runtime value.

PhysicsQueryOptions

PhysicsQueryOptions scripting API.

interface PhysicsQueryOptions
src/runtime/physics/Physics2D.ts:8

Members

includeTriggers

property
PhysicsQueryOptions.includeTriggers: boolean | undefined

PhysicsQueryOptions.includeTriggers runtime value.

layerMask

property
PhysicsQueryOptions.layerMask: LayerMask | undefined

PhysicsQueryOptions.layerMask runtime value.

PolygonCollider2D

Best for irregular objects and complex static geometry; prefer simple shapes when possible.

"PolygonCollider2D"
src/runtime/index.ts:122
RaycastHit2D

RaycastHit2D scripting API.

interface RaycastHit2D
src/runtime/physics/Physics2D.ts:12

Members

collider

property
RaycastHit2D.collider: Collider2D

RaycastHit2D.collider runtime value.

distance

property
RaycastHit2D.distance: number

RaycastHit2D.distance runtime value.

entity

property
RaycastHit2D.entity: RuntimeEntity

RaycastHit2D.entity runtime value.

normal

property
RaycastHit2D.normal: Vector2

RaycastHit2D.normal runtime value.

point

property
RaycastHit2D.point: Vector2

RaycastHit2D.point runtime value.

RaycastOptions

RaycastOptions scripting API.

interface RaycastOptions
src/runtime/physics/Physics2D.ts:9

Members

distance

property
RaycastOptions.distance: number | undefined

RaycastOptions.distance runtime value.

includeTriggers

property
RaycastOptions.includeTriggers: boolean | undefined

RaycastOptions.includeTriggers runtime value.

layerMask

property
RaycastOptions.layerMask: LayerMask | undefined

RaycastOptions.layerMask runtime value.

Rigidbody2D

Component tokens accepted by Entity and Scene component queries.

"Rigidbody2D"
src/runtime/index.ts:114
ShapeCastOptions

ShapeCastOptions scripting API.

interface ShapeCastOptions
src/runtime/physics/Physics2D.ts:11

Members

capsuleDirection

property
ShapeCastOptions.capsuleDirection: "vertical" | "horizontal" | undefined

ShapeCastOptions.capsuleDirection runtime value.

distance

property
ShapeCastOptions.distance: number | undefined

ShapeCastOptions.distance runtime value.

includeTriggers

property
ShapeCastOptions.includeTriggers: boolean | undefined

ShapeCastOptions.includeTriggers runtime value.

layerMask

property
ShapeCastOptions.layerMask: LayerMask | undefined

ShapeCastOptions.layerMask runtime value.

rotation

property
ShapeCastOptions.rotation: number | undefined

ShapeCastOptions.rotation runtime value.

TilemapCollider2D

Best for optimized collision geometry generated from Tilemap collision layers.

"TilemapCollider2D"
src/runtime/index.ts:128
TilemapCollider2DComponent

Builds optimized static collision geometry from Tilemap collision layers.

interface TilemapCollider2DComponent
src/shared/types/components.ts:426

Members

collisionLayerIds

property
TilemapCollider2DComponent.collisionLayerIds: string[]

Empty uses every enabled Tilemap layer marked for collision.

enabled

property
TilemapCollider2DComponent.enabled: boolean

TilemapCollider2DComponent.enabled runtime value.

id

property
TilemapCollider2DComponent.id: string

Stable instance ID used when an entity owns multiple colliders.

isTrigger

property
TilemapCollider2DComponent.isTrigger: boolean

TilemapCollider2DComponent.isTrigger runtime value.

materialId

property
TilemapCollider2DComponent.materialId: string | null

Reserved asset ID for the reusable PhysicsMaterial2D system.

mergeAdjacent

property
TilemapCollider2DComponent.mergeAdjacent: boolean

Greedily merges adjacent solid cells into larger rectangles.

name

property
TilemapCollider2DComponent.name: string

Optional gameplay-facing name, such as MainBody or Feet.

offset

property
TilemapCollider2DComponent.offset: Vector2

TilemapCollider2DComponent.offset runtime value.

oneWay

property
TilemapCollider2DComponent.oneWay: boolean

Makes compatible solid colliders passable from the back side.

oneWayDirection

property
TilemapCollider2DComponent.oneWayDirection: Vector2

World-facing local direction of the solid side.

oneWayTolerance

property
TilemapCollider2DComponent.oneWayTolerance: number

TilemapCollider2DComponent.oneWayTolerance runtime value.

type

property
TilemapCollider2DComponent.type: "TilemapCollider2D"

TilemapCollider2DComponent.type runtime value.

AnimationClip

Serializable property or sprite animation asset.

interface AnimationClip
src/shared/types/animation.ts:70

Members

duration

property
AnimationClip.duration: number

AnimationClip.duration runtime value.

events

property
AnimationClip.events: AnimationEventMarker[] | undefined

Authored callbacks fired when playback crosses their timeline position.

fps

property
AnimationClip.fps: number | undefined

Global frame rate for sprite clips.

frames

property
AnimationClip.frames: SpriteAnimationFrame[] | undefined

Ordered sprite-frame asset references.

id

property
AnimationClip.id: string

AnimationClip.id runtime value.

loop

property
AnimationClip.loop: boolean

AnimationClip.loop runtime value.

name

property
AnimationClip.name: string

AnimationClip.name runtime value.

playback

property
AnimationClip.playback: AnimationPlaybackMode | undefined

Explicit playback behavior. `loop` remains for backwards compatibility.

speed

property
AnimationClip.speed: number

AnimationClip.speed runtime value.

tracks

property
AnimationClip.tracks: AnimationTrack[]

AnimationClip.tracks runtime value.

type

property
AnimationClip.type: "property" | "sprite" | undefined

Legacy/property clips default to `property`; newly-created frame clips use `sprite`.

AnimationEvent

Runtime payload delivered to Script.onAnimationEvent when playback crosses a marker.

interface AnimationEvent
src/shared/types/animation.ts:54

Members

booleanValue

property
AnimationEvent.booleanValue: boolean | undefined

Optional authored boolean parameter.

frame

property
AnimationEvent.frame: number

Zero-based sprite frame index, or -1 for property clips.

name

property
AnimationEvent.name: string

Authored marker name used to select gameplay behavior.

normalizedTime

property
AnimationEvent.normalizedTime: number

Marker time divided by the authored clip duration, in the range zero through one.

numberValue

property
AnimationEvent.numberValue: number | undefined

Optional authored numeric parameter.

stringValue

property
AnimationEvent.stringValue: string | undefined

Optional authored string parameter.

AnimationEventMarker

Serializable event marker authored on an AnimationClip timeline.

interface AnimationEventMarker
src/shared/types/animation.ts:34

Members

booleanValue

property
AnimationEventMarker.booleanValue: boolean | undefined

AnimationEventMarker.booleanValue runtime value.

frameId

property
AnimationEventMarker.frameId: string | undefined

Optional sprite frame identity used to keep frame-authored events attached while reordering.

id

property
AnimationEventMarker.id: string

AnimationEventMarker.id runtime value.

name

property
AnimationEventMarker.name: string

AnimationEventMarker.name runtime value.

numberValue

property
AnimationEventMarker.numberValue: number | undefined

AnimationEventMarker.numberValue runtime value.

stringValue

property
AnimationEventMarker.stringValue: string | undefined

AnimationEventMarker.stringValue runtime value.

time

property
AnimationEventMarker.time: number

Local clip time in seconds.

AnimationPlaybackMode

AnimationPlaybackMode scripting API.

type AnimationPlaybackMode
src/shared/types/animation.ts:31
AnimationState

One named state backed by an AnimationClip asset.

interface AnimationState
src/shared/types/animator.ts:15

Members

clipId

property
AnimationState.clipId: string | null

AnimationState.clipId runtime value.

id

property
AnimationState.id: string

AnimationState.id runtime value.

name

property
AnimationState.name: string

AnimationState.name runtime value.

position

property
AnimationState.position: Vector2

AnimationState.position runtime value.

speed

property
AnimationState.speed: number

AnimationState.speed runtime value.

Animator

Animator scripting API.

"Animator"
src/runtime/index.ts:129
AnimatorController

Serializable state machine used by Animator components.

interface AnimatorController
src/shared/types/animator.ts:47

Members

defaultStateId

property
AnimatorController.defaultStateId: string | null

AnimatorController.defaultStateId runtime value.

id

property
AnimatorController.id: string

AnimatorController.id runtime value.

name

property
AnimatorController.name: string

AnimatorController.name runtime value.

parameters

property
AnimatorController.parameters: AnimatorParameter[]

AnimatorController.parameters runtime value.

states

property
AnimatorController.states: AnimationState[]

AnimatorController.states runtime value.

transitions

property
AnimatorController.transitions: AnimatorTransition[]

AnimatorController.transitions runtime value.

AnimatorParameter

Serializable parameter declaration and its initial value.

interface AnimatorParameter
src/shared/types/animator.ts:7

Members

defaultValue

property
AnimatorParameter.defaultValue: number | boolean

AnimatorParameter.defaultValue runtime value.

id

property
AnimatorParameter.id: string

AnimatorParameter.id runtime value.

name

property
AnimatorParameter.name: string

AnimatorParameter.name runtime value.

type

property
AnimatorParameter.type: AnimatorParameterType

AnimatorParameter.type runtime value.

AnimatorParameterType

Supported Animator Controller parameter kinds.

type AnimatorParameterType
src/shared/types/animator.ts:4
AnimatorTransition

Directed state-machine transition. `fromStateId: null` means Any State.

interface AnimatorTransition
src/shared/types/animator.ts:34

Members

conditions

property
AnimatorTransition.conditions: AnimatorTransitionCondition[]

AnimatorTransition.conditions runtime value.

duration

property
AnimatorTransition.duration: number

Reserved state timing in seconds; sprite textures are not cross-faded.

exitTime

property
AnimatorTransition.exitTime: number

Normalized state time. A value of 1 waits for one complete playback.

fromStateId

property
AnimatorTransition.fromStateId: string | null

AnimatorTransition.fromStateId runtime value.

hasExitTime

property
AnimatorTransition.hasExitTime: boolean

AnimatorTransition.hasExitTime runtime value.

id

property
AnimatorTransition.id: string

AnimatorTransition.id runtime value.

toStateId

property
AnimatorTransition.toStateId: string

AnimatorTransition.toStateId runtime value.

AnimatorTransitionCondition

Parameter predicate required by a transition.

interface AnimatorTransitionCondition
src/shared/types/animator.ts:26

Members

id

property
AnimatorTransitionCondition.id: string

AnimatorTransitionCondition.id runtime value.

operator

property
AnimatorTransitionCondition.operator: AnimatorConditionOperator

AnimatorTransitionCondition.operator runtime value.

parameterId

property
AnimatorTransitionCondition.parameterId: string

AnimatorTransitionCondition.parameterId runtime value.

value

property
AnimatorTransitionCondition.value: number | boolean

AnimatorTransitionCondition.value runtime value.

RuntimeAnimator

Public script-facing controller for an Entity's Animator component.

class RuntimeAnimator
src/runtime/animation/RuntimeAnimator.ts:26

Members

currentAnimation

property
RuntimeAnimator.currentAnimation: string | null

Current AnimationClip name.

currentState

property
RuntimeAnimator.currentState: string | null

Current controller state name, or null for direct clip playback.

getBool

method
RuntimeAnimator.getBool(name: string): boolean

Returns a Bool parameter, or false when it is missing.

getFloat

method
RuntimeAnimator.getFloat(name: string): number

Returns a Float parameter, or zero when it is missing.

getInteger

method
RuntimeAnimator.getInteger(name: string): number

Returns an Integer parameter, or zero when it is missing.

hasAnimation

method
RuntimeAnimator.hasAnimation(name: string): boolean

Returns whether the Animator can play a named AnimationClip.

hasState

method
RuntimeAnimator.hasState(name: string): boolean

Returns whether the assigned controller contains a state.

isPlaying

property
RuntimeAnimator.isPlaying: boolean

Whether animation time is currently advancing.

normalizedTime

property
RuntimeAnimator.normalizedTime: number

Elapsed state time divided by clip duration. Looping states may exceed one.

onComplete

method
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.

pause

method
RuntimeAnimator.pause(): void

Pauses playback at the current frame.

play

method
RuntimeAnimator.play(stateOrClipName: string): void

Plays a controller state, or an AnimationClip when no matching state exists.

playClip

method
RuntimeAnimator.playClip(clip: AnimationClip | string): void

Directly plays an AnimationClip reference, name, or ID. State playback remains recommended.

resetTrigger

method
RuntimeAnimator.resetTrigger(name: string): void

Clears a Trigger parameter without taking a transition.

resume

method
RuntimeAnimator.resume(): void

Resumes playback from the current frame.

setBool

method
RuntimeAnimator.setBool(name: string, value: boolean): void

Sets a Bool parameter used by controller transitions.

setFloat

method
RuntimeAnimator.setFloat(name: string, value: number): void

Sets a Float parameter used by controller transitions.

setInteger

method
RuntimeAnimator.setInteger(name: string, value: number): void

Sets an Integer parameter used by controller transitions.

setTrigger

method
RuntimeAnimator.setTrigger(name: string): void

Arms a Trigger parameter until a matching transition consumes it.

speed

property
RuntimeAnimator.speed: number

Effective component playback multiplier.

stop

method
RuntimeAnimator.stop(): void

Stops playback and rewinds the current state.

SpriteAnimationFrame

One sprite frame reference and optional timing override.

interface SpriteAnimationFrame
src/shared/types/animation.ts:24

Members

duration

property
SpriteAnimationFrame.duration: number | undefined

When omitted, duration is derived from the clip FPS.

id

property
SpriteAnimationFrame.id: string

SpriteAnimationFrame.id runtime value.

spriteAssetId

property
SpriteAnimationFrame.spriteAssetId: string

SpriteAnimationFrame.spriteAssetId runtime value.

UIButtonAnimationConfig

Motion and color-transition settings applied as a UIButton changes interaction state.

interface UIButtonAnimationConfig
src/shared/types/components.ts:178

Members

easing

property
UIButtonAnimationConfig.easing: UIButtonAnimationEasing

UIButtonAnimationConfig.easing runtime value.

enabled

property
UIButtonAnimationConfig.enabled: boolean

UIButtonAnimationConfig.enabled runtime value.

focusedScale

property
UIButtonAnimationConfig.focusedScale: number

UIButtonAnimationConfig.focusedScale runtime value.

focusPulse

property
UIButtonAnimationConfig.focusPulse: boolean

UIButtonAnimationConfig.focusPulse runtime value.

focusPulseAmount

property
UIButtonAnimationConfig.focusPulseAmount: number

UIButtonAnimationConfig.focusPulseAmount runtime value.

focusPulseSpeed

property
UIButtonAnimationConfig.focusPulseSpeed: number

Focus pulse cycles per second.

hoverScale

property
UIButtonAnimationConfig.hoverScale: number

UIButtonAnimationConfig.hoverScale runtime value.

pressDuration

property
UIButtonAnimationConfig.pressDuration: number

Duration in seconds for the faster pressed-state response.

pressedScale

property
UIButtonAnimationConfig.pressedScale: number

UIButtonAnimationConfig.pressedScale runtime value.

releaseBounce

property
UIButtonAnimationConfig.releaseBounce: number

Temporary scale overshoot after releasing a pressed button.

transitionDuration

property
UIButtonAnimationConfig.transitionDuration: number

Duration in seconds for hover, focus, disabled, and release transitions.

UIButtonAnimationEasing

UIButtonAnimationEasing scripting API.

type UIButtonAnimationEasing
src/shared/types/components.ts:175
UIHoverAnimation

Cursor-hover motion for any anchored UI visual.

"UIHoverAnimation"
src/runtime/index.ts:138
UIHoverAnimationComponent

Adds cursor-hover motion to any anchored UI image, text, button, or panel background.

interface UIHoverAnimationComponent
src/shared/types/components.ts:240

Members

easing

property
UIHoverAnimationComponent.easing: UIButtonAnimationEasing

UIHoverAnimationComponent.easing runtime value.

enabled

property
UIHoverAnimationComponent.enabled: boolean

UIHoverAnimationComponent.enabled runtime value.

hoverAlpha

property
UIHoverAnimationComponent.hoverAlpha: number

Target opacity at full hover.

hoverOffset

property
UIHoverAnimationComponent.hoverOffset: Vector2

Screen-pixel offset applied at full hover.

hoverRotation

property
UIHoverAnimationComponent.hoverRotation: number

Clockwise rotation in degrees applied at full hover.

hoverScale

property
UIHoverAnimationComponent.hoverScale: number

Scale multiplier around the element's UI rectangle center.

pointerCursor

property
UIHoverAnimationComponent.pointerCursor: boolean

Shows a pointer cursor while the element is hovered.

transitionDuration

property
UIHoverAnimationComponent.transitionDuration: number

Duration in seconds when entering or leaving the hovered state.

type

property
UIHoverAnimationComponent.type: "UIHoverAnimation"

UIHoverAnimationComponent.type runtime value.

Camera2D

Camera2D scripting API.

"Camera2D"
src/runtime/index.ts:130
SpriteRenderer

SpriteRenderer scripting API.

"SpriteRenderer"
src/runtime/index.ts:132
Tilemap

Stores one layer-based tile grid and optional collision layers.

interface Tilemap
src/shared/types/components.ts:480

Members

activeLayerId

property
Tilemap.activeLayerId: string

Tilemap.activeLayerId runtime value.

columns

property
Tilemap.columns: number

Tilemap.columns runtime value.

enabled

property
Tilemap.enabled: boolean

Tilemap.enabled runtime value.

layers

property
Tilemap.layers: TilemapLayer[]

Tilemap.layers runtime value.

rows

property
Tilemap.rows: number

Tilemap.rows runtime value.

sortingLayer

property
Tilemap.sortingLayer: number

Draw order among world objects. Higher values render in front of lower values.

tilesetAssetId

property
Tilemap.tilesetAssetId: string | null

Tilemap.tilesetAssetId runtime value.

tilesetColumns

property
Tilemap.tilesetColumns: number

Tilemap.tilesetColumns runtime value.

tileSize

property
Tilemap.tileSize: Vector2

Tilemap.tileSize runtime value.

type

property
Tilemap.type: "Tilemap"

Tilemap.type runtime value.

TilemapAutotile

TilemapAutotile scripting API.

interface TilemapAutotile
src/shared/types/components.ts:506

Members

baseTile

property
TilemapAutotile.baseTile: number

Palette tile used as the start of the default sequential 16-tile rule set.

enabled

property
TilemapAutotile.enabled: boolean

TilemapAutotile.enabled runtime value.

ruleTiles

property
TilemapAutotile.ruleTiles: number[]

Tile index for every 4-neighbor mask from 0 through 15.

TilemapLayer

TilemapLayer scripting API.

interface TilemapLayer
src/shared/types/components.ts:493

Members

autotile

property
TilemapLayer.autotile: TilemapAutotile | undefined

Optional 4-neighbor autotile mapping. Rule index bits are north=1, east=2, south=4, west=8.

collision

property
TilemapLayer.collision: boolean

TilemapLayer.collision runtime value.

enabled

property
TilemapLayer.enabled: boolean

TilemapLayer.enabled runtime value.

id

property
TilemapLayer.id: string

TilemapLayer.id runtime value.

name

property
TilemapLayer.name: string

TilemapLayer.name runtime value.

opacity

property
TilemapLayer.opacity: number

TilemapLayer.opacity runtime value.

tiles

property
TilemapLayer.tiles: number[]

TilemapLayer.tiles runtime value.

tilesetAssetId

property
TilemapLayer.tilesetAssetId: string | null | undefined

Overrides the Tilemap's default tileset for this layer.

AudioSource

AudioSource scripting API.

"AudioSource"
src/runtime/index.ts:131
Save

Persistent key-value store for game progress. The runtime supplies the active implementation to user scripts.

SaveApi
src/runtime/scripting/publicApi.ts:48

Members

clear

method
Save.clear(): void

Save.clear runtime operation.

delete

method
Save.delete(key: string): void

Save.delete runtime operation.

get

method
Save.get<T = unknown>(key: string, fallback?: T | null): T | null

Save.get runtime operation.

has

method
Save.has(key: string): boolean

Save.has runtime operation.

keys

method
Save.keys(): string[]

Save.keys runtime operation.

set

method
Save.set(key: string, value: unknown): void

Save.set runtime operation.

SaveApi

Public shape of the Save API exposed to scripts.

interface SaveApi
src/runtime/save/SaveSystem.ts:4

Members

clear

method
SaveApi.clear(): void

SaveApi.clear runtime operation.

delete

method
SaveApi.delete(key: string): void

SaveApi.delete runtime operation.

get

method
SaveApi.get<T = unknown>(key: string, fallback?: T | null): T | null

SaveApi.get runtime operation.

has

method
SaveApi.has(key: string): boolean

SaveApi.has runtime operation.

keys

method
SaveApi.keys(): string[]

SaveApi.keys runtime operation.

set

method
SaveApi.set(key: string, value: unknown): void

SaveApi.set runtime operation.