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

    The ObjectHelper helps tie objects with gids into the tileset that sits behind them.

    Index

    Constructors

    Properties

    enabled: boolean

    Enabled if the object helper reaches in to tilesets for data. Disabled if it only uses data directly on a gid object.

    gids: any[]

    The Tile GIDs array.

    Methods

    • Sets the sprite texture data as specified (usually in a config) or, failing that, as specified in the gid of the object being loaded (if any).

      This fallback will only work if the tileset was loaded as a spritesheet matching the geometry of sprites fed into tiled, so that, for example: "tile id #3"" within the tileset is the same as texture frame 3 from the image of the tileset.

      Parameters

      • sprite: GameObject

        The Game Object to modify.

      • Optionalkey: string | Textures.Texture

        The texture key to set (or else the obj.gid's tile is used if available).

      • Optionalframe: string | number | Frame

        The frames key to set (or else the obj.gid's tile is used if available).

      • Optionalobj: TiledObject

        The Tiled object for fallback.

      Returns void