Skip to content

loadTilemap

loadTilemap(game, url, options?): Promise<TilemapAsset>

Fetches a Tiled JSON map and loads its tilesets as textures, without spawning anything: load each map once, then spawn it in every scene that uses it (game.scene clears the world, so a restart spawns it again). const level = await loadTilemap(game, url), then const map = level.spawn() in the scene. options.z is the default for spawn. Needs the webgl2 plugin.

Game

string

number

Promise<TilemapAsset>