Skip to content

marble3 / mountLoadingScreen

Function: mountLoadingScreen() ​

mountLoadingScreen(fps): object

Defined in: src/loading.ts:47

Covers a world with an opaque loading screen and keeps it paused until its assets are in, so the player never sees a half-built scene. FPS calls this from its constructor.

It listens to THREE.DefaultLoadingManager, so it sees only loaders built without a manager of their own, and must be mounted before the first asset is requested. It goes away once nothing has been loading for 350 ms (150 ms if nothing was ever requested), or after 30 s whatever is still pending; a failed asset counts as loaded.

Parameters ​

fps ​

Paused now and resumed when the screen goes away.

pause ​

resume ​

Returns ​

object

overlay, to append to the game's container, and dismiss() to end it at once.

dismiss ​

dismiss: () => void

Returns ​

void

overlay ​

overlay: HTMLElement