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

registerMaps

registerMaps(modules): Disposer

Names each map file a lazy glob found after its file, so src/maps/blockout.json is blockout, and keeps src/maps/materials.json as the look every map shares: registerMaps(import.meta.glob("./maps/*.json")). A map’s file loads when a <Landscape> first mounts it, under the loading screen, so no map is in the page’s first load; materials.json loads at once. A map that had loaded under a name registered again, as a game module run again after a write to the file, loads the new file at once and shows the old one until it lands. The return forgets them all.

Parameter Type
modules MapModules

Disposer