@kayahr/wastelib
    Preparing search index...

    Class Tileset

    Container for a set of tiles read from an allhtds file.

    Index

    Constructors

    • Creates a new tileset with the given tiles.

      Parameters

      • tiles: Tile[]

        The tiles in this set.

      • disk: number

        The disk number.

      Returns Tileset

    Methods

    • Returns the disk number.

      Returns number

      The disk number.

    • Returns the number of tiles in this set.

      Returns number

      The number of tiles.

    • Returns the tile with the given index.

      Parameters

      • index: number

        The index of the tile image to return.

      Returns Tile

      The tile image.

    • Creates and returns a new canvas containing the tileset image. 16 tilesets per row.

      Returns HTMLCanvasElement

      The created canvas.

    • Creates and returns a tileset image data URL. 16 tiles per row.

      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 of the tileset. 16 tiles per row.

      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.