arcade-physics
Version:
Use Arcade Physics without Phaser.
30 lines • 1.76 kB
TypeScript
export = ForEachTile;
/**
* @callback EachTileCallback
*
* @param {Phaser.Tilemaps.Tile} value - The Tile.
* @param {number} index - The index of the tile.
* @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects.
*/
/**
* For each tile in the given rectangular area (in tile coordinates) of the layer, run the given
* callback. Similar to Array.prototype.forEach in vanilla JS.
*
* @function Phaser.Tilemaps.Components.ForEachTile
* @since 3.0.0
*
* @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.
* @param {object} context - The context under which the callback should be run.
* @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {number} width - How many tiles wide from the `tileX` index the area will be.
* @param {number} height - How many tiles tall from the `tileY` index the area will be.
* @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.
*/
declare function ForEachTile(callback: EachTileCallback, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): void;
declare namespace ForEachTile {
export { EachTileCallback };
}
type EachTileCallback = (value: Phaser.Tilemaps.Tile, index: number, array: Phaser.Tilemaps.Tile[]) => any;
//# sourceMappingURL=ForEachTile.d.ts.map