level id
load options, with async set
resolves true once the level is in the world
load a level into the game manager
(will also create all level defined entities, etc..)
While the game loop is running the load is DEFERRED to a timer, so this
returns before anything is in the world. Sequence follow-up work from
options.onLoaded, from an event.LEVEL_LOADED listener, or by passing
async: true and awaiting the promise that overload returns.
Note that await me.level.load(id) without async: true does not await
the load: the call returns a boolean, and await true resolves at once.
level id
Optionaloptions: LevelLoadOptions & { async?: false }
additional optional parameters
true
// load a level
me.level.load("a4_level1");
// load into a specific container
me.level.load("a4_level2", { container: levelContainer });
// a glTF/GLB scene (preloaded with type "glb") under a Camera3d:
// 50 pixels per glTF unit, authored intensities kept at a 1/1000 scale
me.level.load("diorama", { scale: 50, lightIntensityScale: 0.001 });
load a level into the game manager, and return a promise that settles once it is actually in the world
(will also create all level defined entities, etc..)
options.onLoadedstill fires, so the two forms mix freely. An unknownlevelIdthrows SYNCHRONOUSLY rather than rejecting — that is a typo, not a load failure, and it should not needawaitto surface.