Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

LoadingScreen

LoadingScreen(props): Element

The engine’s loading screen: the game’s art, name, line and tips, over a line the width of the screen that fills as the load goes, with the percent riding its end and the stage under it. A stall or a failure takes the tips’ place, with a button that reloads. Game draws it from the page’s first frame until the first playable one, and a game that draws its own screen can draw this inside it.

Parameter Type Description
props { art?: string; label?: string; line?: string; problem?: LoadingProblem | null; retry?: () => void; tips?: readonly string[]; title?: string; value: number | null; } -
props.art? string The address of an image drawn behind the screen, filling it, such as a file in the game’s public folder. The screen darkens it toward the bar, so the words stay readable over it.
props.label? string That stage in plain words, such as “Preparing shaders”.
props.line? string One line under the name.
props.problem? LoadingProblem | null A stall or a failure to show, or null.
props.retry? () => void Reloads the page, for the button a problem shows.
props.tips? readonly string[] Lines shown one at a time over the bar, each for a few seconds, in their order.
props.title? string The game’s name, large, over the bar.
props.value number | null How far the load is, from 0 to 1; null for a screen with no load to show, such as the one an error leaves.

Element