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:412
True while the requestAnimationFrame loop is running.
boolean
get world(): World;Defined in: src/engine/boot/Engine.ts:193
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:221
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:517
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:293
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:417
Start the requestAnimationFrame loop.
void
step(dt): void;Defined in: src/engine/boot/Engine.ts:442
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:431
void
worlds(): readonly WorldHandle[];Defined in: src/engine/boot/Engine.ts:304
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:156
EngineOptions = {}
Promise<Engine>
static createWorld(config): WorldHandle;Defined in: src/engine/boot/Engine.ts:202
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:207
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