Type Alias BpxJsonAsset

BpxJsonAsset: {
    json: any;
}

Type declaration

  • json: any

    A content of the fetched JSON file.

const statsUrl: BpxJsonUrl = "level.ldtk"; // refers to `./public/stats.json`
const levelUrl: BpxJsonUrl = "https://the.url/of/level.ldtk";

let stats: BpxJsonAsset;
let level: BpxJsonAsset;

$.setOnStarted(() => {
const stats: BpxJsonAsset = $.getJsonAsset(statsUrl);
const level: BpxJsonAsset = $.getJsonAsset(levelUrl);
});

$.start({
// ...,
assets: [
statsUrl,
levelUrl,
],
});