PokéRogue
    Preparing search index...

    An Image Collection is a special Tile Set where each entry is a complete, individual image rather than a tile sliced from a larger spritesheet. Unlike a standard Tile Set, every image in the collection is its own standalone asset referenced by a unique global ID (GID).

    Image Collections are normally created automatically when Tiled map data is loaded. You would encounter them when a Tiled map uses the "Collection of Images" tile set type instead of the standard single-image tile set type.

    Index
    • Parameters

      • name: string

        The name of the image collection in the map data.

      • firstgid: number

        The first image index this image collection contains.

      • Optionalwidth: number

        Width of widest image (in pixels). Default 32.

      • Optionalheight: number

        Height of tallest image (in pixels). Default 32.

      • Optionalmargin: number

        The margin around all images in the collection (in pixels). Default 0.

      • Optionalspacing: number

        The spacing between each image in the collection (in pixels). Default 0.

      • Optionalproperties: object

        Custom Image Collection properties. Default {}.

      Returns ImageCollection

    firstgid: number

    The Tiled firstgid value. This is the starting index of the first image index this Image Collection contains.

    imageHeight: number

    The height of the tallest image (in pixels).

    imageMargin: number

    The margin around the images in the collection (in pixels).

    images: any[]

    The cached images that are a part of this collection.

    imageSpacing: number

    The spacing between each image in the collection (in pixels).

    imageWidth: number

    The width of the widest image (in pixels).

    name: string

    The name of the Image Collection.

    properties: object

    Image Collection-specific properties that are typically defined in the Tiled editor.

    total: number

    The total number of images in the image collection.

    • Add an image to this Image Collection.

      Parameters

      • gid: number

        The gid of the image in the Image Collection.

      • image: string

        The key of the image in the Image Collection and in the cache.

      • width: number

        The width of the image in the Image Collection.

      • height: number

        The height of the image in the Image Collection.

      Returns ImageCollection

      This ImageCollection object.

    • Returns true if and only if this image collection contains the given image index.

      Parameters

      • imageIndex: number

        The image index to search for.

      Returns boolean

      True if this Image Collection contains the given index.