Type Alias BpxImageAsset

BpxImageAsset: {
    channels: 3 | 4;
    height: number;
    rgba8bitData: PngDataArray;
    width: number;
}

Type declaration

  • channels: 3 | 4

    Number of image channels.

  • height: number

    Image's height in pixels.

  • rgba8bitData: PngDataArray

    The actual image data.

  • width: number

    Image's width in pixels.

const sprite1Url: BpxImageUrl = "spritesheet.png"; // refers to `./public/spritesheet.png`
const sprite2Url: BpxImageUrl = "https://the.url/of/another-spritesheet.png";

let sprite1: BpxSprite;
let sprite2: BpxSprite;

$.setOnStarted(() => {
sprite1 = $spr(sprite1Url)(8,8,0,0);
sprite2 = $spr(sprite2Url)(8,8,0,0);
});

$.start({
// ...,
assets: [
sprite1Url,
sprite2Url,
],
});