UNPKG

arcade-physics

Version:
79 lines 3.58 kB
export = Tilemap; /** * @callback TilemapFilterCallback * * @param {Phaser.GameObjects.GameObject} value - An object found in the filtered area. * @param {number} index - The index of the object within the array. * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. * * @return {Phaser.GameObjects.GameObject} The object. */ /** * @callback TilemapFindCallback * * @param {Phaser.GameObjects.GameObject} value - An object found. * @param {number} index - The index of the object within the array. * @param {Phaser.GameObjects.GameObject[]} array - An array of all the objects found. * * @return {boolean} `true` if the callback should be invoked, otherwise `false`. */ /** * @classdesc * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or * more tilemap layers, which are the display objects that actually render the tiles. * * The Tilemap data can be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free * software package specifically for creating tile maps, and is available from: * http://www.mapeditor.org * * As of Phaser 3.50.0 the Tilemap API now supports the following types of map: * * 1) Orthogonal * 2) Isometric * 3) Hexagonal * 4) Staggered * * Prior to this release, only orthogonal maps were supported. * * Another large change in 3.50 was the consolidation of Tilemap Layers. Previously, you created * either a Static or Dynamic Tilemap Layer. However, as of 3.50 the features of both have been * merged and the API simplified, so now there is just the single `TilemapLayer` class. * * A Tilemap has handy methods for getting and manipulating the tiles within a layer, allowing * you to build or modify the tilemap data at runtime. * * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a * TilemapLayer may have its own unique tile size that overrides this. * * As of Phaser 3.21.0, if your tilemap includes layer groups (a feature of Tiled 1.2.0+) these * will be traversed and the following properties will impact children: * * - Opacity (blended with parent) and visibility (parent overrides child) * - Vertical and horizontal offset * * The grouping hierarchy is not preserved and all layers will be flattened into a single array. * * Group layers are parsed during Tilemap construction but are discarded after parsing so dynamic * layers will NOT continue to be affected by a parent. * * To avoid duplicate layer names, a layer that is a child of a group layer will have its parent * group name prepended with a '/'. For example, consider a group called 'ParentGroup' with a * child called 'Layer 1'. In the Tilemap object, 'Layer 1' will have the name * 'ParentGroup/Layer 1'. * * @class Tilemap * @memberof Phaser.Tilemaps * @constructor * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene to which this Tilemap belongs. * @param {Phaser.Tilemaps.MapData} mapData - A MapData instance containing Tilemap data. */ declare var Tilemap: any; declare namespace Tilemap { export { TilemapFilterCallback, TilemapFindCallback }; } type TilemapFilterCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[]) => Phaser.GameObjects.GameObject; type TilemapFindCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[]) => boolean; //# sourceMappingURL=Tilemap.d.ts.map