phaser - v4.0.0-rc.4
    Preparing search index...

    An Image Collection is a special Tile Set containing multiple images, with no slicing into each image.

    Image Collections are normally created automatically when Tiled data is loaded.

    Index

    Constructors

    • 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

    Properties

    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).

    imageMarge: number

    The margin around the images in the collection (in pixels). Use setSpacing to change.

    images: any[]

    The cached images that are a part of this collection.

    imageSpacing: number

    The spacing between each image in the collection (in pixels). Use setSpacing to change.

    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.

    Methods

    • Add an image to this Image Collection.

      Parameters

      • gid: number

        The gid of the image in the Image Collection.

      • image: string

        The 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

    • 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