melonJS
    Preparing search index...

    Interface Asset

    interface Asset {
        autoplay?: boolean;
        data?: string;
        loop?: boolean;
        name: string;
        src?: string | string[];
        stream?: boolean;
        type: string;
    }
    Index
    autoplay?: boolean

    Set to true to automatically start playing audio or video when loaded or added to a scene (using autoplay might require user iteraction to enable it)

    data?: string

    inline content if not provided through a src url: TMX data for "tmx" assets, GLSL source (the ShaderEffect fragment-body convention) for "shader" assets

    loop?: boolean

    Set to true to automatically loop the audio or video when playing

    name: string

    name of the asset

    src?: string | string[]

    path and/or file name of the resource (for audio assets only the path is required). For image assets, an array of sources can be provided as a fallback chain (e.g. compressed texture formats by priority, with a PNG fallback). The loader will try each source in order and use the first one that loads successfully.

    stream?: boolean

    Set to true to not to wait for large audio or video file to be downloaded before playing.

    type: string

    the type of the asset ("audio"|"binary"|"image"|"json"|"js"|"tmx"|"tsx"|"fontface"|"video"|"aseprite"|"shader"|"obj"|"mtl"|"gltf"|"glb"). JSON-serialised Tiled maps and tilesets (.tmj / .tsj) load under "tmx" / "tsx" — those are file extensions, not asset types.