mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
Lots of jsdoc and type fixes
This commit is contained in:
parent
5587b00fc5
commit
4f6f6ee72f
22 changed files with 152 additions and 183 deletions
|
@ -1624,7 +1624,7 @@ var FacebookInstantGamesPlugin = new Class({
|
|||
* @param {string} cta - The call to action text.
|
||||
* @param {object} text - The text object.
|
||||
* @param {string} key - The key of the texture to use as the share image.
|
||||
* @param {(string|integer)} [frame] - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.
|
||||
* @param {?(string|integer)} frame - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.
|
||||
* @param {string} template - The update template key.
|
||||
* @param {object} updateData - The update data object payload.
|
||||
*
|
||||
|
@ -1662,7 +1662,7 @@ var FacebookInstantGamesPlugin = new Class({
|
|||
* @param {string} cta - The call to action text.
|
||||
* @param {object} text - The text object.
|
||||
* @param {string} key - The key of the texture to use as the share image.
|
||||
* @param {(string|integer)} [frame] - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.
|
||||
* @param {?(string|integer)} frame - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.
|
||||
* @param {string} template - The update template key.
|
||||
* @param {object} updateData - The update data object payload.
|
||||
*
|
||||
|
@ -1684,7 +1684,7 @@ var FacebookInstantGamesPlugin = new Class({
|
|||
* @param {string} cta - The call to action text.
|
||||
* @param {object} text - The text object.
|
||||
* @param {string} key - The key of the texture to use as the share image.
|
||||
* @param {(string|integer)} [frame] - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.
|
||||
* @param {?(string|integer)} frame - The frame of the texture to use as the share image. Set to `null` if you don't require a frame, but do need to set session data.
|
||||
* @param {string} template - The update template key.
|
||||
* @param {object} updateData - The update data object payload.
|
||||
*
|
||||
|
|
|
@ -244,7 +244,7 @@ var Camera = new Class({
|
|||
*
|
||||
* This is only set if Phaser is running with the WebGL Renderer.
|
||||
*
|
||||
* @name Phaser.Cameras.Scene2D.Camera#framebuffer
|
||||
* @name Phaser.Cameras.Scene2D.Camera#glTexture
|
||||
* @type {?WebGLTexture}
|
||||
* @since 3.13.0
|
||||
*/
|
||||
|
|
|
@ -199,9 +199,10 @@ var Animation = new Class({
|
|||
* An Internal trigger that's play the animation in reverse mode ('true') or not ('false'),
|
||||
* needed because forward can be changed by yoyo feature.
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Animation#forward
|
||||
* @name Phaser.GameObjects.Components.Animation#_reverse
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @private
|
||||
* @since 3.12.0
|
||||
*/
|
||||
this._reverse = false;
|
||||
|
|
|
@ -730,6 +730,15 @@ var Graphics = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* @typedef {object} RoundedRectRadius
|
||||
*
|
||||
* @property {number} [tl=20] - Top left
|
||||
* @property {number} [tr=20] - Top right
|
||||
* @property {number} [br=20] - Bottom right
|
||||
* @property {number} [bl=20] - Bottom left
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fill a rounded rectangle with the given position, size and radius.
|
||||
*
|
||||
|
@ -740,11 +749,7 @@ var Graphics = new Class({
|
|||
* @param {number} y - The y coordinate of the top-left of the rectangle.
|
||||
* @param {number} width - The width of the rectangle.
|
||||
* @param {number} height - The height of the rectangle.
|
||||
* @param {number} [radius = 20] - The corner radius; It can also be an object to specify different radii for corners
|
||||
* @param {number} [radius.tl = 20] Top left
|
||||
* @param {number} [radius.tr = 20] Top right
|
||||
* @param {number} [radius.br = 20] Bottom right
|
||||
* @param {number} [radius.bl = 20] Bottom left
|
||||
* @param {(RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Graphics} This Game Object.
|
||||
*/
|
||||
|
@ -790,11 +795,7 @@ var Graphics = new Class({
|
|||
* @param {number} y - The y coordinate of the top-left of the rectangle.
|
||||
* @param {number} width - The width of the rectangle.
|
||||
* @param {number} height - The height of the rectangle.
|
||||
* @param {number} [radius = 20] - The corner radius; It can also be an object to specify different radii for corners
|
||||
* @param {number} [radius.tl = 20] Top left
|
||||
* @param {number} [radius.tr = 20] Top right
|
||||
* @param {number} [radius.br = 20] Bottom right
|
||||
* @param {number} [radius.bl = 20] Bottom left
|
||||
* @param {(RoundedRectRadius|number)} [radius=20] - The corner radius; It can also be an object to specify different radii for corners.
|
||||
*
|
||||
* @return {Phaser.GameObjects.Graphics} This Game Object.
|
||||
*/
|
||||
|
|
|
@ -260,7 +260,7 @@ var RenderTexture = new Class({
|
|||
/**
|
||||
* Sets the size of this Game Object.
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Size#setSize
|
||||
* @method Phaser.GameObjects.RenderTexture#setSize
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} width - The width of this Game Object.
|
||||
|
|
|
@ -14,7 +14,7 @@ var FileTypesManager = {
|
|||
* Loops through the local types object and injects all of them as
|
||||
* properties into the LoaderPlugin instance.
|
||||
*
|
||||
* @method Phaser.Loader.FileTypesManager.register
|
||||
* @method Phaser.Loader.FileTypesManager.install
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into.
|
||||
|
|
|
@ -78,7 +78,7 @@ var MultiAtlasFile = new Class({
|
|||
/**
|
||||
* Called by each File when it finishes loading.
|
||||
*
|
||||
* @method Phaser.Loader.MultiFile#onFileComplete
|
||||
* @method Phaser.Loader.MultiAtlasFile#onFileComplete
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {Phaser.Loader.File} file - The File that has completed processing.
|
||||
|
@ -151,7 +151,7 @@ var MultiAtlasFile = new Class({
|
|||
/**
|
||||
* Adds this file to its target cache upon successful loading and processing.
|
||||
*
|
||||
* @method Phaser.Loader.MultiFile#addToCache
|
||||
* @method Phaser.Loader.MultiAtlasFile#addToCache
|
||||
* @since 3.7.0
|
||||
*/
|
||||
addToCache: function ()
|
||||
|
|
|
@ -1512,7 +1512,7 @@ var World = new Class({
|
|||
* @param {Phaser.Physics.Arcade.Body} body1 - The first Body to be separated.
|
||||
* @param {Phaser.Physics.Arcade.Body} body2 - The second Body to be separated.
|
||||
* @param {boolean} [overlapOnly] - If this a collide or overlap check?
|
||||
* @param {number} bias - A small value added to the calculations.
|
||||
* @param {number} [bias] - A small value added to the calculations.
|
||||
*
|
||||
* @return {boolean} True if separation occurred, otherwise false.
|
||||
*/
|
||||
|
@ -2170,7 +2170,7 @@ var World = new Class({
|
|||
* @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide.
|
||||
* @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`.
|
||||
* @param {any} [callbackContext] - The context in which to run the callbacks.
|
||||
* @param {boolean} overlapOnly - Whether this is a collision or overlap check.
|
||||
* @param {boolean} [overlapOnly] - Whether this is a collision or overlap check.
|
||||
*
|
||||
* @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated.
|
||||
*/
|
||||
|
|
|
@ -325,6 +325,20 @@ var World = new Class({
|
|||
return this.collisionMap;
|
||||
},
|
||||
|
||||
/**
|
||||
* @typedef {object} CollisionOptions
|
||||
*
|
||||
* @property {string} [slopeTileProperty=null] - Slope IDs can be stored on tiles directly
|
||||
* using Impacts tileset editor. If a tile has a property with the given slopeTileProperty string
|
||||
* name, the value of that property for the tile will be used for its slope mapping. E.g. a 45
|
||||
* degree slope upward could be given a "slope" property with a value of 2.
|
||||
* @property {object} [slopeMap=null] - A tile index to slope definition map.
|
||||
* @property {integer} [defaultCollidingSlope=null] - If specified, the default slope ID to
|
||||
* assign to a colliding tile. If not specified, the tile's index is used.
|
||||
* @property {integer} [defaultNonCollidingSlope=0] - The default slope ID to assign to a
|
||||
* non-colliding tile.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets the collision map for the world from a tilemap layer. Only tiles that are marked as
|
||||
* colliding will be used. You can specify the mapping from tiles to slope IDs in a couple of
|
||||
|
@ -335,16 +349,7 @@ var World = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemap layer to use.
|
||||
* @param {object} [options] - Options for controlling the mapping from tiles to slope IDs.
|
||||
* @param {string} [options.slopeTileProperty=null] - Slope IDs can be stored on tiles directly
|
||||
* using Tiled's tileset editor. If a tile has a property with the given slopeTileProperty string
|
||||
* name, the value of that property for the tile will be used for its slope mapping. E.g. a 45
|
||||
* degree slope upward could be given a "slope" property with a value of 2.
|
||||
* @param {object} [options.slopeMap=null] - A tile index to slope definition map.
|
||||
* @param {integer} [options.defaultCollidingSlope=null] - If specified, the default slope ID to
|
||||
* assign to a colliding tile. If not specified, the tile's index is used.
|
||||
* @param {integer} [options.defaultNonCollidingSlope=0] - The default slope ID to assign to a
|
||||
* non-colliding tile.
|
||||
* @param {CollisionOptions} [options] - Options for controlling the mapping from tiles to slope IDs.
|
||||
*
|
||||
* @return {Phaser.Physics.Impact.CollisionMap} The newly created CollisionMap.
|
||||
*/
|
||||
|
|
|
@ -12,6 +12,14 @@ var GetFastValue = require('../../utils/object/GetFastValue');
|
|||
var HasValue = require('../../utils/object/HasValue');
|
||||
var Vertices = require('./lib/geometry/Vertices');
|
||||
|
||||
/**
|
||||
* @typedef {object} MatterTileOptions
|
||||
*
|
||||
* @property {Phaser.Physics.Matter.Matter.Body} [body=null] - An existing Matter body to be used instead of creating a new one.
|
||||
* @property {boolean} [isStatic=true] - Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved.
|
||||
* @property {boolean} [addToWorld=true] - Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A wrapper around a Tile that provides access to a corresponding Matter body. A tile can only
|
||||
|
@ -41,14 +49,7 @@ var Vertices = require('./lib/geometry/Vertices');
|
|||
*
|
||||
* @param {Phaser.Physics.Matter.World} world - [description]
|
||||
* @param {Phaser.Tilemaps.Tile} tile - The target tile that should have a Matter body.
|
||||
* @param {object} [options] - Options to be used when creating the Matter body. See
|
||||
* Phaser.Physics.Matter.Matter.Body for a list of what Matter accepts.
|
||||
* @param {Phaser.Physics.Matter.Matter.Body} [options.body=null] - An existing Matter body to
|
||||
* be used instead of creating a new one.
|
||||
* @param {boolean} [options.isStatic=true] - Whether or not the newly created body should be
|
||||
* made static. This defaults to true since typically tiles should not be moved.
|
||||
* @param {boolean} [options.addToWorld=true] - Whether or not to add the newly created body (or
|
||||
* existing body if options.body is used) to the Matter world.
|
||||
* @param {MatterTileOptions} [options] - Options to be used when creating the Matter body.
|
||||
*/
|
||||
var MatterTileBody = new Class({
|
||||
|
||||
|
@ -120,17 +121,20 @@ var MatterTileBody = new Class({
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @typedef {object} MatterBodyTileOptions
|
||||
*
|
||||
* @property {boolean} [isStatic=true] - Whether or not the newly created body should be made static. This defaults to true since typically tiles should not be moved.
|
||||
* @property {boolean} [addToWorld=true] - Whether or not to add the newly created body (or existing body if options.body is used) to the Matter world.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets the current body to a rectangle that matches the bounds of the tile.
|
||||
*
|
||||
* @method Phaser.Physics.Matter.TileBody#setFromTileRectangle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts.
|
||||
* @param {boolean} [options.isStatic=true] - Whether or not the newly created body should be
|
||||
* made static. This defaults to true since typically tiles should not be moved.
|
||||
* @param {boolean} [options.addToWorld=true] - Whether or not to add the newly created body (or
|
||||
* existing body if options.body is used) to the Matter world.
|
||||
* @param {MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts.
|
||||
*
|
||||
* @return {Phaser.Physics.Matter.TileBody} This TileBody object.
|
||||
*/
|
||||
|
@ -164,11 +168,7 @@ var MatterTileBody = new Class({
|
|||
* @method Phaser.Physics.Matter.TileBody#setFromTileCollision
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts.
|
||||
* @param {boolean} [options.isStatic=true] - Whether or not the newly created body should be
|
||||
* made static. This defaults to true since typically tiles should not be moved.
|
||||
* @param {boolean} [options.addToWorld=true] - Whether or not to add the newly created body (or
|
||||
* existing body if options.body is used) to the Matter world.
|
||||
* @param {MatterBodyTileOptions} [options] - Options to be used when creating the Matter body. See MatterJS.Body for a list of what Matter accepts.
|
||||
*
|
||||
* @return {Phaser.Physics.Matter.TileBody} This TileBody object.
|
||||
*/
|
||||
|
|
|
@ -178,7 +178,7 @@ var ForwardDiffuseLightPipeline = new Class({
|
|||
/**
|
||||
* Generic function for batching a textured quad
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline#batchTexture
|
||||
* @method Phaser.Renderer.WebGL.Pipelines.ForwardDiffuseLightPipeline#batchTexture
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject
|
||||
|
|
|
@ -331,7 +331,7 @@ var ScaleManager = new Class({
|
|||
*
|
||||
* @method Phaser.Scale.ScaleManager#boot
|
||||
* @protected
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*/
|
||||
boot: function ()
|
||||
|
@ -615,7 +615,7 @@ var ScaleManager = new Class({
|
|||
* other Scale Manager features.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#setParentSize
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @param {number} width - The new width of the parent.
|
||||
|
@ -634,7 +634,7 @@ var ScaleManager = new Class({
|
|||
* This method will set a new size for your game.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#setGameSize
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @param {number} width - The new width of the game.
|
||||
|
@ -688,7 +688,7 @@ var ScaleManager = new Class({
|
|||
* alone. Finally, the `displayScale` is adjusted and the RESIZE event dispatched.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#resize
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @param {number} width - The new width of the game.
|
||||
|
@ -753,7 +753,7 @@ var ScaleManager = new Class({
|
|||
* Sets the zoom value of the Scale Manager.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#setZoom
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @param {integer} value - The new zoom value of the game.
|
||||
|
@ -771,7 +771,7 @@ var ScaleManager = new Class({
|
|||
* Sets the zoom to be the maximum possible based on the _current_ parent size.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#setMaxZoom
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @return {this} The Scale Manager instance.
|
||||
|
@ -792,7 +792,7 @@ var ScaleManager = new Class({
|
|||
* as long as it is using a Scale Mode other than 'NONE'.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#refresh
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @return {this} The Scale Manager instance.
|
||||
|
@ -816,7 +816,7 @@ var ScaleManager = new Class({
|
|||
* If the orientation has changed it updates the orientation property and then dispatches the orientation change event.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#updateOrientation
|
||||
* @fires Phaser.Scale.ScaleManager.Events#ORIENTATION_CHANGE
|
||||
* @fires Phaser.Scale.Events#ORIENTATION_CHANGE
|
||||
* @since 3.16.0
|
||||
*/
|
||||
updateOrientation: function ()
|
||||
|
@ -1065,9 +1065,9 @@ var ScaleManager = new Class({
|
|||
* When it leaves fullscreen, the div will be removed.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#startFullscreen
|
||||
* @fires Phaser.Scale.ScaleManager.Events#ENTER_FULLSCREEN
|
||||
* @fires Phaser.Scale.ScaleManager.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#ENTER_FULLSCREEN
|
||||
* @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @param {FullscreenOptions} [fullscreenOptions] - The FullscreenOptions dictionary is used to provide configuration options when entering full screen.
|
||||
|
@ -1153,8 +1153,8 @@ var ScaleManager = new Class({
|
|||
* Calling this method will cancel fullscreen mode, if the browser has entered it.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#stopFullscreen
|
||||
* @fires Phaser.Scale.ScaleManager.Events#LEAVE_FULLSCREEN
|
||||
* @fires Phaser.Scale.ScaleManager.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @fires Phaser.Scale.Events#LEAVE_FULLSCREEN
|
||||
* @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @since 3.16.0
|
||||
*/
|
||||
stopFullscreen: function ()
|
||||
|
@ -1203,10 +1203,10 @@ var ScaleManager = new Class({
|
|||
* from fullscreen unless the iframe has the `allowfullscreen` attribute.
|
||||
*
|
||||
* @method Phaser.Scale.ScaleManager#toggleFullscreen
|
||||
* @fires Phaser.Scale.ScaleManager.Events#ENTER_FULLSCREEN
|
||||
* @fires Phaser.Scale.ScaleManager.Events#LEAVE_FULLSCREEN
|
||||
* @fires Phaser.Scale.ScaleManager.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @fires Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @fires Phaser.Scale.Events#ENTER_FULLSCREEN
|
||||
* @fires Phaser.Scale.Events#LEAVE_FULLSCREEN
|
||||
* @fires Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @fires Phaser.Scale.Events#RESIZE
|
||||
* @since 3.16.0
|
||||
*
|
||||
* @param {FullscreenOptions} [fullscreenOptions] - The FullscreenOptions dictionary is used to provide configuration options when entering full screen.
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
/**
|
||||
* The Scale Manager Resize Event.
|
||||
*
|
||||
* @event Phaser.Scale.ScaleManager.Events#ENTER_FULLSCREEN
|
||||
* @event Phaser.Scale.Events#ENTER_FULLSCREEN
|
||||
*/
|
||||
module.exports = 'enterfullscreen';
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
/**
|
||||
* The Scale Manager Resize Event.
|
||||
*
|
||||
* @event Phaser.Scale.ScaleManager.Events#FULLSCREEN_UNSUPPORTED
|
||||
* @event Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED
|
||||
*/
|
||||
module.exports = 'fullscreenunsupported';
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
/**
|
||||
* The Scale Manager Resize Event.
|
||||
*
|
||||
* @event Phaser.Scale.ScaleManager.Events#LEAVE_FULLSCREEN
|
||||
* @event Phaser.Scale.Events#LEAVE_FULLSCREEN
|
||||
*/
|
||||
module.exports = 'leavefullscreen';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
/**
|
||||
* The Scale Manager Resize Event.
|
||||
*
|
||||
* @event Phaser.Scale.ScaleManager.Events#ORIENTATION_CHANGE
|
||||
* @event Phaser.Scale.Events#ORIENTATION_CHANGE
|
||||
*
|
||||
* @param {string} orientation -
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
/**
|
||||
* The Scale Manager Resize Event.
|
||||
*
|
||||
* @event Phaser.Scale.ScaleManager.Events#RESIZE
|
||||
* @event Phaser.Scale.Events#RESIZE
|
||||
*
|
||||
* @param {Phaser.Structs.Size} gameSize -
|
||||
* @param {Phaser.Structs.Size} baseSize -
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @namespace Phaser.DOM.ScaleManager.Events
|
||||
* @namespace Phaser.Scale.Events
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -34,6 +34,7 @@ var CONST = require('./const');
|
|||
var Scale = {
|
||||
|
||||
Center: require('./const/CENTER_CONST'),
|
||||
Events: require('./events'),
|
||||
Orientation: require('./const/ORIENTATION_CONST'),
|
||||
ScaleManager: require('./ScaleManager'),
|
||||
ScaleModes: require('./const/SCALE_MODE_CONST'),
|
||||
|
|
|
@ -838,6 +838,14 @@ 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
|
||||
|
@ -855,10 +863,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {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.
|
||||
|
@ -946,10 +951,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {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.
|
||||
|
@ -978,10 +980,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {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.
|
||||
|
@ -1192,10 +1191,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {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.
|
||||
|
@ -1218,10 +1214,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {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.
|
||||
*
|
||||
|
@ -1247,10 +1240,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {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.
|
||||
*
|
||||
|
@ -1643,6 +1633,14 @@ var Tilemap = new Class({
|
|||
return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, layer);
|
||||
},
|
||||
|
||||
/**
|
||||
* @typedef {object} StyleConfig
|
||||
*
|
||||
* @property {?Color} [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 {?Color} [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 {?Color} [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
|
||||
|
@ -1655,10 +1653,7 @@ var Tilemap = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.
|
||||
* @param {object} styleConfig - An object specifying the colors to use for the debug drawing.
|
||||
* @param {?Color} [styleConfig.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.
|
||||
* @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
|
||||
* @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn.
|
||||
* @param {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.
|
||||
|
|
|
@ -497,6 +497,14 @@ var DynamicTilemapLayer = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* @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
|
||||
|
@ -513,10 +521,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 {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
|
||||
*/
|
||||
|
@ -561,10 +566,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 {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
|
||||
*
|
||||
* @return {?Phaser.Tilemaps.Tile}
|
||||
*/
|
||||
|
@ -586,10 +588,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 {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.
|
||||
*/
|
||||
|
@ -646,10 +645,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 {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {object} [FilteringOptions] - Optional filters to apply when getting the tiles.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
|
||||
*/
|
||||
|
@ -666,10 +662,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 {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {object} [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.
|
||||
|
@ -689,10 +682,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 {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
|
||||
* @param {object} [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.
|
||||
|
@ -868,6 +858,14 @@ var DynamicTilemapLayer = new Class({
|
|||
return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, this.layer);
|
||||
},
|
||||
|
||||
/**
|
||||
* @typedef {object} StyleConfig
|
||||
*
|
||||
* @property {?Color} [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 {?Color} [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 {?Color} [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
|
||||
|
@ -878,13 +876,7 @@ var DynamicTilemapLayer = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.
|
||||
* @param {object} styleConfig - An object specifying the colors to use for the debug drawing.
|
||||
* @param {?Color} [styleConfig.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.
|
||||
* @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled
|
||||
* rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
|
||||
* @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting
|
||||
* tile faces. If set to null, interesting tile faces will not be drawn.
|
||||
* @param {StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.
|
||||
*/
|
||||
|
@ -1087,7 +1079,7 @@ var DynamicTilemapLayer = new Class({
|
|||
* @method Phaser.Tilemaps.DynamicTilemapLayer#setTileIndexCallback
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for.
|
||||
* @param {(integer|integer[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for.
|
||||
* @param {function} callback - The callback that will be invoked when the tile is collided with.
|
||||
* @param {object} callbackContext - The context under which the callback is called.
|
||||
*
|
||||
|
@ -1112,7 +1104,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 {function} callback - The callback that will be invoked when the tile is collided with.
|
||||
* @param {function} [callback] - The callback that will be invoked when the tile is collided with.
|
||||
* @param {object} [callbackContext] - The context under which the callback is called.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.
|
||||
|
|
|
@ -928,6 +928,14 @@ var StaticTilemapLayer = new Class({
|
|||
return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer);
|
||||
},
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Find the first tile in the given rectangular area (in tile coordinates) of the layer that
|
||||
* satisfies the provided testing function. I.e. finds the first tile for which `callback` returns
|
||||
|
@ -943,13 +951,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
|
||||
* -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide
|
||||
* on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
|
||||
* have at least one interesting face.
|
||||
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
*
|
||||
* @return {?Phaser.Tilemaps.Tile}
|
||||
*/
|
||||
|
@ -974,13 +976,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
|
||||
* -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide
|
||||
* on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
|
||||
* have at least one interesting face.
|
||||
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
|
||||
*/
|
||||
|
@ -1003,13 +999,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
|
||||
* -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide
|
||||
* on at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
|
||||
* have at least one interesting face.
|
||||
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.
|
||||
*/
|
||||
|
@ -1068,13 +1058,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
|
||||
* -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on
|
||||
* at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
|
||||
* have at least one interesting face.
|
||||
* @param {FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
|
||||
*/
|
||||
|
@ -1093,13 +1077,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
|
||||
* -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on
|
||||
* at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
|
||||
* have at least one interesting face.
|
||||
* @param {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.
|
||||
|
@ -1117,13 +1095,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 {object} [filteringOptions] - Optional filters to apply when getting the tiles.
|
||||
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
|
||||
* -1 for an index.
|
||||
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on
|
||||
* at least one side.
|
||||
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
|
||||
* have at least one interesting face.
|
||||
* @param {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.
|
||||
|
@ -1168,6 +1140,14 @@ var StaticTilemapLayer = new Class({
|
|||
return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer);
|
||||
},
|
||||
|
||||
/**
|
||||
* @typedef {object} StyleConfig
|
||||
*
|
||||
* @property {?Color} [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 {?Color} [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 {?Color} [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
|
||||
|
@ -1178,13 +1158,7 @@ var StaticTilemapLayer = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.
|
||||
* @param {object} styleConfig - An object specifying the colors to use for the debug drawing.
|
||||
* @param {?Color} [styleConfig.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.
|
||||
* @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled
|
||||
* rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
|
||||
* @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting
|
||||
* tile faces. If set to null, interesting tile faces will not be drawn.
|
||||
* @param {StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue