API

Interface LoadAtlasOptions

Options for loadSpriteAtlas. PR 1 supports the gridSize path only.

interface LoadAtlasOptions {
    gridSize?: readonly [number, number];
    metadataUrl?: string;
    premultipliedAlpha?: boolean;
    premultiplyOnLoad?: boolean;
    sampling?: SpriteSampling;
    textureOptions?: Texture2DOptions;
}
Index
gridSize?: readonly [number, number]

Grid cell size [w, h] in pixels. Required in PR 1.

metadataUrl?: string

Reserved for future PR — TexturePacker-style JSON. Throws if used in PR 1.

premultipliedAlpha?: boolean

Marks the atlas as carrying premultiplied RGBA so the renderer picks the premultiplied blend pipeline (srcFactor: ONE). Default false — matches the bits PNG decoding produces. Set together with premultiplyOnLoad: true for mathematically correct soft edges. Setting this true without premultiplyOnLoad: true is only correct if the source image is already premultiplied on disk (e.g. produced by a build step).

premultiplyOnLoad?: boolean

Tell the texture loader to premultiply alpha at decode time (createImageBitmap({ premultiplyAlpha: "premultiply" })). Default false. Pair with premultipliedAlpha: true for the premultiplied blend pipeline.

sampling?: SpriteSampling
textureOptions?: Texture2DOptions