Repository navigation
API Class Engine
Defined in: src/engine/boot/Engine.ts:95
Owns the Worlds and drives them frame by frame (ADR 0011, 0032). A bootstrap creates the
start-up Worlds; game code creates more at runtime through handles. engine.world is the
default World: the first one the bootstrap made.
const engine = await Engine.create({ container, project, assets });
await SceneManager.load("scenes/main.scene.json");
engine.start();BootstrapEngineWorldOwner
readonly settings: ProjectSettings;Defined in: src/engine/boot/Engine.ts:96
get isRunning(): boolean;Defined in: src/engine/boot/Engine.ts:433
True while the requestAnimationFrame loop is running.
boolean
get world(): World;Defined in: src/engine/boot/Engine.ts:195
The default World: the first one the bootstrap created (the next one, if that's destroyed).
World
createWorld(config): WorldHandle;Defined in: src/engine/boot/Engine.ts:223
Create a World in this Engine. See Engine.createWorld. Its scenes load in the background
(Engine.create waits for the start-up Worlds'), and it steps from the next frame on.
string | WorldConfig
dispose(): void;Defined in: src/engine/boot/Engine.ts:554
Stop the loop, destroy every World's nodes (scripts get onDestroy, audio stops), release GPU resources, then release the project context (ADR 0319): the asset sources it was given go, and storage goes back to the backend of the Engine created before it that's still alive (the editor's, after Play), or the one in use before.
void
findWorld(name): WorldHandle | null;Defined in: src/engine/boot/Engine.ts:300
A handle on one of this Engine's Worlds, by name, or null.
string
WorldHandle | null
start(): void;Defined in: src/engine/boot/Engine.ts:438
Start the requestAnimationFrame loop.
void
step(dt): void;Defined in: src/engine/boot/Engine.ts:463
Advance one frame by dt real seconds. Used by the loop; call it directly in tests.
As in Unity's player loop, every unpaused World steps once, in creation order, each on its
own clock (ADR 0032). Afterwards the default World is current again.
number
void
stop(): void;Defined in: src/engine/boot/Engine.ts:452
void
worlds(): readonly WorldHandle[];Defined in: src/engine/boot/Engine.ts:311
Handles on every World, in creation (and step) order. For the editor and bootstraps, not game scripts.
readonly WorldHandle[]
WorldOwner.worlds
static create(options?): Promise<Engine>;Defined in: src/engine/boot/Engine.ts:158
EngineOptions = {}
Promise<Engine>
static createWorld(config): WorldHandle;Defined in: src/engine/boot/Engine.ts:204
Create a World in the Engine that's running the current World (ADR 0032), e.g. from a menu's
"Host" button. config is a WorldConfig or the name of a bootstrap template.
string | WorldConfig
static findWorld(name): WorldHandle | null;Defined in: src/engine/boot/Engine.ts:209
A handle on a World of the current World's Engine, by name, or null.
string
WorldHandle | null
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference