melonJS
    Preparing search index...

    Function getBinary

    • Get the content of a loaded "binary" asset, decoded as UTF-8 text: what a bitmap font's .fnt descriptor, for one, is loaded as.

      Parameters

      • elt: string

        the asset name

      Returns object

      the file's content, as a string, or null if none is loaded under that name

      // a bitmap font: its image, and its descriptor as "binary"
      await loader.preload([
      { name: "PressStart2P", type: "image", src: "data/fnt/PressStart2P.png" },
      { name: "PressStart2P", type: "binary", src: "data/fnt/PressStart2P.fnt" },
      ]);
      const fnt = loader.getBinary("PressStart2P");