Final batch of typedefs

This commit is contained in:
Richard Davey 2019-02-13 16:06:00 +00:00
parent ccf677dfa6
commit 4fc817c519
24 changed files with 182 additions and 153 deletions

View file

@ -838,14 +838,6 @@ var Tilemap = new Class({
return objectLayer.objects.filter(callback, context);
},
/**
* @typedef {object} FilteringOptions
*
* @property {boolean} [isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @property {boolean} [isColliding=false] - If true, only return tiles that collide on at least one side.
* @property {boolean} [hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
*/
/**
* For each tile in the given rectangular area (in tile coordinates) of the layer, run the given
* filter callback function. Any tiles that pass the filter test (i.e. where the callback returns
@ -863,7 +855,7 @@ var Tilemap = new Class({
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.
@ -951,7 +943,7 @@ var Tilemap = new Class({
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid.
@ -980,7 +972,7 @@ var Tilemap = new Class({
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer.
*
* @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.
@ -1191,7 +1183,7 @@ var Tilemap = new Class({
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.
@ -1214,7 +1206,7 @@ var Tilemap = new Class({
* @since 3.0.0
*
* @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.
* @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.
*
@ -1240,7 +1232,7 @@ var Tilemap = new Class({
* @param {number} worldY - The world y coordinate for the top-left of the area.
* @param {number} width - The width of the area.
* @param {number} height - The height of the area.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.
* @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.
*
@ -1633,14 +1625,6 @@ var Tilemap = new Class({
return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, layer);
},
/**
* @typedef {object} StyleConfig
*
* @property {?number} [tileColor=blue] - Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn.
* @property {?number} [collidingTileColor=orange] - Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
* @property {?number} [faceColor=grey] - Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn.
*/
/**
* Draws a debug representation of the layer to the given Graphics. This is helpful when you want to
* get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles
@ -1653,7 +1637,7 @@ var Tilemap = new Class({
* @since 3.0.0
*
* @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.
* @param {StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.
* @param {Phaser.Tilemaps.Types.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.
* @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.

View file

@ -7,23 +7,6 @@
var GameObjectCreator = require('../gameobjects/GameObjectCreator');
var ParseToTilemap = require('./ParseToTilemap');
/**
* @typedef {object} TilemapConfig
*
* @property {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data.
* @property {integer[][]} [data] - Instead of loading from the cache, you can also load directly from a 2D array of tile indexes.
* @property {integer} [tileWidth=32] - The width of a tile in pixels.
* @property {integer} [tileHeight=32] - The height of a tile in pixels.
* @property {integer} [width=10] - The width of the map in tiles.
* @property {integer} [height=10] - The height of the map in tiles.
* @property {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1,
* in the map data are handled. If `true`, empty locations will get a value of `null`. If `false`,
* empty location will get a Tile object with an index of -1. If you've a large sparsely populated
* map and the tile data doesn't need to change then setting this value to `true` will help with
* memory consumption. However if your map is small or you need to update the tiles dynamically,
* then leave the default value set.
*/
/**
* Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided.
* When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing
@ -33,7 +16,7 @@ var ParseToTilemap = require('./ParseToTilemap');
* @method Phaser.GameObjects.GameObjectCreator#tilemap
* @since 3.0.0
*
* @param {TilemapConfig} [config] - The config options for the Tilemap.
* @param {Phaser.Tilemaps.Types.TilemapConfig} [config] - The config options for the Tilemap.
*
* @return {Phaser.Tilemaps.Tilemap}
*/

View file

@ -6,14 +6,6 @@
var GetFastValue = require('../../utils/object/GetFastValue');
/**
* @typedef {object} GetTilesWithinFilteringOptions
*
* @property {boolean} [isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @property {boolean} [isColliding=false] - If true, only return tiles that collide on at least one side.
* @property {boolean} [hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
*/
/**
* Gets the tiles in the given rectangular area (in tile coordinates) of the layer.
*
@ -25,7 +17,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} width - How many tiles wide from the `tileX` index the area will be.
* @param {integer} height - How many tiles tall from the `tileY` index the area will be.
* @param {object} GetTilesWithinFilteringOptions - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.GetTilesWithinFilteringOptions} GetTilesWithinFilteringOptions - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.
*
* @return {Phaser.Tilemaps.Tile[]} Array of Tile objects.

View file

@ -513,7 +513,7 @@ var DynamicTilemapLayer = new Class({
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
*/
@ -558,7 +558,7 @@ var DynamicTilemapLayer = new Class({
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
*
* @return {?Phaser.Tilemaps.Tile}
*/
@ -580,7 +580,7 @@ var DynamicTilemapLayer = new Class({
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
*
* @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.
*/
@ -637,7 +637,7 @@ var DynamicTilemapLayer = new Class({
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
*/
@ -654,7 +654,7 @@ var DynamicTilemapLayer = new Class({
* @since 3.0.0
*
* @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
@ -674,7 +674,7 @@ var DynamicTilemapLayer = new Class({
* @param {number} worldY - The world y coordinate for the top-left of the area.
* @param {number} width - The width of the area.
* @param {number} height - The height of the area.
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
@ -860,7 +860,7 @@ var DynamicTilemapLayer = new Class({
* @since 3.0.0
*
* @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.
* @param {StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.
* @param {Phaser.Tilemaps.Types.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.
*
* @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.
*/

View file

@ -7,29 +7,6 @@
var Class = require('../../utils/Class');
var GetFastValue = require('../../utils/object/GetFastValue');
/**
* @typedef {object} MapDataConfig
* @property {string} [name] - The key in the Phaser cache that corresponds to the loaded tilemap data.
* @property {number} [width=0] - The width of the entire tilemap.
* @property {number} [height=0] - The height of the entire tilemap.
* @property {number} [tileWidth=0] - The width of the tiles.
* @property {number} [tileHeight=0] - The height of the tiles.
* @property {number} [widthInPixels] - The width in pixels of the entire tilemap.
* @property {number} [heightInPixels] - The height in pixels of the entire tilemap.
* @property {integer} [format] - The format of the Tilemap, as defined in Tiled.
* @property {string} [orientation] - The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'.
* @property {string} [renderOrder] - Determines the draw order of tilemap. Default is right-down.
* @property {number} [version] - The version of Tiled the map uses.
* @property {number} [properties] - Map specific properties (can be specified in Tiled).
* @property {Phaser.Tilemaps.LayerData[]} [layers] - The layers of the tilemap.
* @property {array} [images] - An array with all the layers configured to the MapData.
* @property {object} [objects] - An array of Tiled Image Layers.
* @property {object} [collision] - An object of Tiled Object Layers.
* @property {Phaser.Tilemaps.Tileset[]} [tilesets] - The tilesets the map uses.
* @property {array} [imageCollections] - The collection of images the map uses(specified in Tiled).
* @property {array} [tiles] - [description]
*/
/**
* @classdesc
* A class for representing data about a map. Maps are parsed from CSV, Tiled, etc. into this
@ -41,7 +18,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @constructor
* @since 3.0.0
*
* @param {MapDataConfig} [config] - [description]
* @param {Phaser.Tilemaps.Types.MapDataConfig} [config] - The Map configuration object.
*/
var MapData = new Class({

View file

@ -943,7 +943,7 @@ var StaticTilemapLayer = new Class({
* @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
*
* @return {?Phaser.Tilemaps.Tile}
*/
@ -968,7 +968,7 @@ var StaticTilemapLayer = new Class({
* @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
*/
@ -991,7 +991,7 @@ var StaticTilemapLayer = new Class({
* @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
*
* @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.
*/
@ -1050,7 +1050,7 @@ var StaticTilemapLayer = new Class({
* @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
*/
@ -1069,7 +1069,7 @@ var StaticTilemapLayer = new Class({
* @param {number} worldY - The topmost 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 high from the `tileY` index the area will be.
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
@ -1087,7 +1087,7 @@ var StaticTilemapLayer = new Class({
* @since 3.0.0
*
* @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Tilemaps.Types.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
@ -1142,7 +1142,7 @@ var StaticTilemapLayer = new Class({
* @since 3.0.0
*
* @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.
* @param {StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.
* @param {Phaser.Tilemaps.Types.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.
*
* @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.
*/

View file

@ -0,0 +1,8 @@
/**
* @typedef {object} Phaser.Tilemaps.Types.FilteringOptions
* @since 3.0.0
*
* @property {boolean} [isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @property {boolean} [isColliding=false] - If true, only return tiles that collide on at least one side.
* @property {boolean} [hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
*/

View file

@ -0,0 +1,8 @@
/**
* @typedef {object} Phaser.Tilemaps.Types.GetTilesWithinFilteringOptions
* @since 3.0.0
*
* @property {boolean} [isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @property {boolean} [isColliding=false] - If true, only return tiles that collide on at least one side.
* @property {boolean} [hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
*/

View file

@ -0,0 +1,24 @@
/**
* @typedef {object} Phaser.Tilemaps.Types.MapDataConfig
* @since 3.0.0
*
* @property {string} [name] - The key in the Phaser cache that corresponds to the loaded tilemap data.
* @property {number} [width=0] - The width of the entire tilemap.
* @property {number} [height=0] - The height of the entire tilemap.
* @property {number} [tileWidth=0] - The width of the tiles.
* @property {number} [tileHeight=0] - The height of the tiles.
* @property {number} [widthInPixels] - The width in pixels of the entire tilemap.
* @property {number} [heightInPixels] - The height in pixels of the entire tilemap.
* @property {integer} [format] - The format of the Tilemap, as defined in Tiled.
* @property {string} [orientation] - The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'.
* @property {string} [renderOrder] - Determines the draw order of tilemap. Default is right-down.
* @property {number} [version] - The version of Tiled the map uses.
* @property {number} [properties] - Map specific properties (can be specified in Tiled).
* @property {Phaser.Tilemaps.LayerData[]} [layers] - The layers of the tilemap.
* @property {array} [images] - An array with all the layers configured to the MapData.
* @property {object} [objects] - An array of Tiled Image Layers.
* @property {object} [collision] - An object of Tiled Object Layers.
* @property {Phaser.Tilemaps.Tileset[]} [tilesets] - The tilesets the map uses.
* @property {array} [imageCollections] - The collection of images the map uses(specified in Tiled).
* @property {array} [tiles] - [description]
*/

View file

@ -0,0 +1,8 @@
/**
* @typedef {object} Phaser.Tilemaps.Types.StyleConfig
* @since 3.0.0
*
* @property {?number} [tileColor=blue] - Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn.
* @property {?number} [collidingTileColor=orange] - Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
* @property {?number} [faceColor=grey] - Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn.
*/

View file

@ -0,0 +1,17 @@
/**
* @typedef {object} Phaser.Tilemaps.Types.TilemapConfig
* @since 3.0.0
*
* @property {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data.
* @property {integer[][]} [data] - Instead of loading from the cache, you can also load directly from a 2D array of tile indexes.
* @property {integer} [tileWidth=32] - The width of a tile in pixels.
* @property {integer} [tileHeight=32] - The height of a tile in pixels.
* @property {integer} [width=10] - The width of the map in tiles.
* @property {integer} [height=10] - The height of the map in tiles.
* @property {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1,
* in the map data are handled. If `true`, empty locations will get a value of `null`. If `false`,
* empty location will get a Tile object with an index of -1. If you've a large sparsely populated
* map and the tile data doesn't need to change then setting this value to `true` will help with
* memory consumption. However if your map is small or you need to update the tiles dynamically,
* then leave the default value set.
*/

View file

@ -0,0 +1,9 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @namespace Phaser.Tilemaps.Types
*/

View file

@ -156,7 +156,7 @@ var Clock = new Class({
* @method Phaser.Time.Clock#addEvent
* @since 3.0.0
*
* @param {TimerEventConfig} config - The configuration for the Timer Event.
* @param {Phaser.Time.Types.TimerEventConfig} config - The configuration for the Timer Event.
*
* @return {Phaser.Time.TimerEvent} The Timer Event which was created.
*/

View file

@ -7,20 +7,6 @@
var Class = require('../utils/Class');
var GetFastValue = require('../utils/object/GetFastValue');
/**
* @typedef {object} TimerEventConfig
*
* @property {number} [delay=0] - The delay after which the Timer Event should fire, in milliseconds.
* @property {number} [repeat=0] - The total number of times the Timer Event will repeat before finishing.
* @property {boolean} [loop=false] - `true` if the Timer Event should repeat indefinitely.
* @property {function} [callback] - The callback which will be called when the Timer Event fires.
* @property {*} [callbackScope] - The scope (`this` object) with which to invoke the `callback`.
* @property {Array.<*>} [args] - Additional arguments to be passed to the `callback`.
* @property {number} [timeScale=1] - The scale of the elapsed time.
* @property {number} [startAt=1] - The initial elapsed time in milliseconds. Useful if you want a long duration with repeat, but for the first loop to fire quickly.
* @property {boolean} [paused=false] - `true` if the Timer Event should be paused.
*/
/**
* @classdesc
* A Timer Event represents a delayed function call. It's managed by a Scene's {@link Clock} and will call its function after a set amount of time has passed. The Timer Event can optionally repeat - i.e. call its function multiple times before finishing, or loop indefinitely.
@ -32,7 +18,7 @@ var GetFastValue = require('../utils/object/GetFastValue');
* @constructor
* @since 3.0.0
*
* @param {TimerEventConfig} config - The configuration for the Timer Event, including its delay and callback.
* @param {Phaser.Time.Types.TimerEventConfig} config - The configuration for the Timer Event, including its delay and callback.
*/
var TimerEvent = new Class({
@ -173,7 +159,7 @@ var TimerEvent = new Class({
* @method Phaser.Time.TimerEvent#reset
* @since 3.0.0
*
* @param {TimerEventConfig} config - The new state for the Timer Event.
* @param {Phaser.Time.Types.TimerEventConfig} config - The new state for the Timer Event.
*
* @return {Phaser.Time.TimerEvent} This TimerEvent object.
*/

View file

@ -0,0 +1,14 @@
/**
* @typedef {object} Phaser.Time.Types.TimerEventConfig
* @since 3.0.0
*
* @property {number} [delay=0] - The delay after which the Timer Event should fire, in milliseconds.
* @property {number} [repeat=0] - The total number of times the Timer Event will repeat before finishing.
* @property {boolean} [loop=false] - `true` if the Timer Event should repeat indefinitely.
* @property {function} [callback] - The callback which will be called when the Timer Event fires.
* @property {*} [callbackScope] - The scope (`this` object) with which to invoke the `callback`.
* @property {Array.<*>} [args] - Additional arguments to be passed to the `callback`.
* @property {number} [timeScale=1] - The scale of the elapsed time.
* @property {number} [startAt=1] - The initial elapsed time in milliseconds. Useful if you want a long duration with repeat, but for the first loop to fire quickly.
* @property {boolean} [paused=false] - `true` if the Timer Event should be paused.
*/

View file

@ -0,0 +1,9 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @namespace Phaser.Time.Types
*/

View file

@ -22,7 +22,7 @@ var TweenData = require('../tween/TweenData');
*
* @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - [description]
* @param {object} config - [description]
* @param {Phaser.Tweens.TweenConfigDefaults} defaults - [description]
* @param {Phaser.Tweens.Types.TweenConfigDefaults} defaults - [description]
*
* @return {Phaser.Tweens.Tween} [description]
*/

View file

@ -24,7 +24,7 @@ var TweenData = require('../tween/TweenData');
*
* @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - [description]
* @param {object} config - [description]
* @param {Phaser.Tweens.TweenConfigDefaults} defaults - Tween configuration defaults.
* @param {Phaser.Tweens.Types.TweenConfigDefaults} defaults - Tween configuration defaults.
`
* @property {(object|object[])} targets - The object, or an array of objects, to run the tween on.
* @property {number} [delay=0] - The number of milliseconds to delay before the tween will start.

View file

@ -5,7 +5,8 @@
*/
/**
* @typedef {object} Phaser.Tweens.TweenConfigDefaults
* @typedef {object} Phaser.Tweens.Types.TweenConfigDefaults
* @since 3.0.0
*
* @property {(object|object[])} targets - The object, or an array of objects, to run the tween on.
* @property {number} [delay=0] - The number of milliseconds to delay before the tween will start.

View file

@ -21,7 +21,7 @@ var TWEEN_CONST = require('./const');
* @since 3.0.0
*
* @param {(Phaser.Tweens.TweenManager|Phaser.Tweens.Timeline)} parent - A reference to the parent of this Tween. Either the Tween Manager or a Tween Timeline instance.
* @param {Phaser.Tweens.TweenDataConfig[]} data - An array of TweenData objects, each containing a unique property to be tweened.
* @param {Phaser.Tweens.Types.TweenDataConfig[]} data - An array of TweenData objects, each containing a unique property to be tweened.
* @param {array} targets - An array of targets to be tweened.
*/
var Tween = new Class({
@ -53,7 +53,7 @@ var Tween = new Class({
* An array of TweenData objects, each containing a unique property and target being tweened.
*
* @name Phaser.Tweens.Tween#data
* @type {Phaser.Tweens.TweenDataConfig[]}
* @type {Phaser.Tweens.Types.TweenDataConfig[]}
* @since 3.0.0
*/
this.data = data;
@ -1045,7 +1045,7 @@ var Tween = new Class({
* @since 3.0.0
*
* @param {Phaser.Tweens.Tween} tween - The Tween to update.
* @param {Phaser.Tweens.TweenDataConfig} tweenData - The TweenData property to update.
* @param {Phaser.Tweens.Types.TweenDataConfig} tweenData - The TweenData property to update.
* @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values.
*
* @return {integer} The state of this Tween.
@ -1149,7 +1149,7 @@ var Tween = new Class({
* @since 3.0.0
*
* @param {Phaser.Tweens.Tween} tween - The Tween to update.
* @param {Phaser.Tweens.TweenDataConfig} tweenData - The TweenData property to update.
* @param {Phaser.Tweens.Types.TweenDataConfig} tweenData - The TweenData property to update.
* @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values.
*
* @return {integer} The state of this Tween.
@ -1213,7 +1213,7 @@ var Tween = new Class({
* @since 3.0.0
*
* @param {Phaser.Tweens.Tween} tween - The Tween to update.
* @param {Phaser.Tweens.TweenDataConfig} tweenData - The TweenData property to update.
* @param {Phaser.Tweens.Types.TweenDataConfig} tweenData - The TweenData property to update.
* @param {number} delta - Either a value in ms, or 1 if Tween.useFrames is true
*
* @return {boolean} [description]

View file

@ -4,45 +4,6 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @typedef {object} TweenDataGenConfig
*
* @property {function} delay - Time in ms/frames before tween will start.
* @property {function} duration - Duration of the tween in ms/frames, excludes time for yoyo or repeats.
* @property {function} hold - Time in ms/frames the tween will pause before running the yoyo or starting a repeat.
* @property {function} repeat - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice.
* @property {function} repeatDelay - Time in ms/frames before the repeat will start.
*/
/**
* @typedef {object} Phaser.Tweens.TweenDataConfig
*
* @property {object} target - The target to tween.
* @property {string} key - The property of the target being tweened.
* @property {function} getEndValue - The returned value sets what the property will be at the END of the Tween.
* @property {function} getStartValue - The returned value sets what the property will be at the START of the Tween.
* @property {function} ease - The ease function this tween uses.
* @property {number} [duration=0] - Duration of the tween in ms/frames, excludes time for yoyo or repeats.
* @property {number} [totalDuration=0] - The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo)
* @property {number} [delay=0] - Time in ms/frames before tween will start.
* @property {boolean} [yoyo=false] - Cause the tween to return back to its start value after hold has expired.
* @property {number} [hold=0] - Time in ms/frames the tween will pause before running the yoyo or starting a repeat.
* @property {integer} [repeat=0] - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice.
* @property {number} [repeatDelay=0] - Time in ms/frames before the repeat will start.
* @property {boolean} [flipX=false] - Automatically call toggleFlipX when the TweenData yoyos or repeats
* @property {boolean} [flipY=false] - Automatically call toggleFlipY when the TweenData yoyos or repeats
* @property {number} [progress=0] - Between 0 and 1 showing completion of this TweenData.
* @property {number} [elapsed=0] - Delta counter
* @property {integer} [repeatCounter=0] - How many repeats are left to run?
* @property {number} [start=0] - Ease value data.
* @property {number} [current=0] - Ease value data.
* @property {number} [end=0] - Ease value data.
* @property {number} [t1=0] - Time duration 1.
* @property {number} [t2=0] - Time duration 2.
* @property {TweenDataGenConfig} [gen] - LoadValue generation functions.
* @property {integer} [state=0] - TWEEN_CONST.CREATED
*/
/**
* Returns a TweenDataConfig object that describes the tween data for a unique property of a unique target. A single Tween consists of multiple TweenDatas, depending on how many properties are being changed by the Tween.
*
@ -65,7 +26,7 @@
* @param {boolean} flipX - Should toggleFlipX be called when yoyo or repeat happens?
* @param {boolean} flipY - Should toggleFlipY be called when yoyo or repeat happens?
*
* @return {TweenDataConfig} The config object describing this TweenData.
* @return {Phaser.Tweens.Types.TweenDataConfig} The config object describing this TweenData.
*/
var TweenData = function (target, key, getEnd, getStart, ease, delay, duration, yoyo, hold, repeat, repeatDelay, flipX, flipY)
{

View file

@ -0,0 +1,29 @@
/**
* @typedef {object} Phaser.Tweens.Types.TweenDataConfig
* @since 3.0.0
*
* @property {any} target - The target to tween.
* @property {string} key - The property of the target being tweened.
* @property {function} getEndValue - The returned value sets what the property will be at the END of the Tween.
* @property {function} getStartValue - The returned value sets what the property will be at the START of the Tween.
* @property {function} ease - The ease function this tween uses.
* @property {number} [duration=0] - Duration of the tween in ms/frames, excludes time for yoyo or repeats.
* @property {number} [totalDuration=0] - The total calculated duration of this TweenData (based on duration, repeat, delay and yoyo)
* @property {number} [delay=0] - Time in ms/frames before tween will start.
* @property {boolean} [yoyo=false] - Cause the tween to return back to its start value after hold has expired.
* @property {number} [hold=0] - Time in ms/frames the tween will pause before running the yoyo or starting a repeat.
* @property {integer} [repeat=0] - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice.
* @property {number} [repeatDelay=0] - Time in ms/frames before the repeat will start.
* @property {boolean} [flipX=false] - Automatically call toggleFlipX when the TweenData yoyos or repeats
* @property {boolean} [flipY=false] - Automatically call toggleFlipY when the TweenData yoyos or repeats
* @property {number} [progress=0] - Between 0 and 1 showing completion of this TweenData.
* @property {number} [elapsed=0] - Delta counter
* @property {integer} [repeatCounter=0] - How many repeats are left to run?
* @property {number} [start=0] - Ease value data.
* @property {number} [current=0] - Ease value data.
* @property {number} [end=0] - Ease value data.
* @property {number} [t1=0] - Time duration 1.
* @property {number} [t2=0] - Time duration 2.
* @property {Phaser.Tweens.Types.TweenDataGenConfig} [gen] - LoadValue generation functions.
* @property {integer} [state=0] - TWEEN_CONST.CREATED
*/

View file

@ -0,0 +1,10 @@
/**
* @typedef {object} Phaser.Tweens.Types.TweenDataGenConfig
* @since 3.0.0
*
* @property {function} delay - Time in ms/frames before tween will start.
* @property {function} duration - Duration of the tween in ms/frames, excludes time for yoyo or repeats.
* @property {function} hold - Time in ms/frames the tween will pause before running the yoyo or starting a repeat.
* @property {function} repeat - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice.
* @property {function} repeatDelay - Time in ms/frames before the repeat will start.
*/

View file

@ -0,0 +1,9 @@
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @namespace Phaser.Tweens.Types
*/