@kayahr/wastelib
    Preparing search index...

    Class Sprites

    Container for the 10 sprites defined in the ic0_9.wlf and masks.wlf files.

    Index

    Methods

    • Returns the number of sprites.

      Returns number

      The number of sprites.

    • Returns the sprite image with the given index.

      Parameters

      • index: number

        The index of the sprite.

      Returns Sprite

      The sprite image.

    • Creates and returns a new canvas containing all the sprites.

      Returns HTMLCanvasElement

      The created canvas.

    • Creates and returns an image data URL of an image with all sprites.

      Parameters

      • Optionaltype: string

        Optional image mime type. Defaults to image/png.

      • Optionalquality: number

        Optional quality parameter for encoder. For image/jpeg this is the image quality between 0 and 1 with a default value of 0.92.

      Returns string

      The created data URL.

    • Creates and returns a HTML image with all sprites.

      Parameters

      • Optionaltype: string

        Optional image mime type. Defaults to image/png.

      • Optionalquality: number

        Optional quality parameter for encoder. For image/jpeg this is the image quality between 0 and 1 with a default value of 0.92.

      Returns HTMLImageElement

      The created HTML image.

    • Parses sprites from the given arrays and returns it.

      Parameters

      • imageArray: Uint8Array

        The image data array with the ico0_9.wlf file content to parse.

      • maskArray: Uint8Array

        The transparency mask array with the masks.wlf file content to parse.

      Returns Sprites

      The parsed sprites.

    • Reads sprites from the given blobs and returns it.

      Parameters

      • imagesBlob: Blob

        The IC0_9.WLF blob to read.

      • masksBlob: Blob

        The MASKS.WLF blob to read.

      Returns Promise<Sprites>

      The read sprites.