mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
Added hundreds of new jsdoc descriptions
This commit is contained in:
parent
ec6715ba8b
commit
e297b3272e
39 changed files with 318 additions and 297 deletions
|
@ -117,6 +117,7 @@ snowbillr
|
|||
Stephen Hamilton
|
||||
STuFF
|
||||
TadejZupancic
|
||||
telinc1
|
||||
|
||||
## Version 3.13.0 - Yuuki - 20th September 2018
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
var GetPoints = require('../geom/line/GetPoints');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Positions an array of Game Objects on evenly spaced points of a Line.
|
||||
*
|
||||
* @function Phaser.Actions.PlaceOnLine
|
||||
* @since 3.0.0
|
||||
|
@ -15,7 +15,7 @@ var GetPoints = require('../geom/line/GetPoints');
|
|||
* @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]
|
||||
*
|
||||
* @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.
|
||||
* @param {Phaser.Geom.Line} line - [description]
|
||||
* @param {Phaser.Geom.Line} line - The Line to position the Game Objects on.
|
||||
*
|
||||
* @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.
|
||||
*/
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks.
|
||||
*
|
||||
* @see {@link Phaser.GameObjects.GameObject#setInteractive}
|
||||
*
|
||||
* @function Phaser.Actions.SetHitArea
|
||||
* @since 3.0.0
|
||||
|
@ -13,8 +15,8 @@
|
|||
* @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]
|
||||
*
|
||||
* @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.
|
||||
* @param {*} hitArea - [description]
|
||||
* @param {HitAreaCallback} hitAreaCallback - [description]
|
||||
* @param {*} hitArea - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.
|
||||
* @param {HitAreaCallback} hitAreaCallback - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.
|
||||
*
|
||||
* @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.
|
||||
*/
|
||||
|
|
|
@ -21,8 +21,8 @@ var GetValue = require('../utils/object/GetValue');
|
|||
* @property {array} [data=[]] - [description]
|
||||
* @property {HTMLCanvasElement} [canvas=null] - [description]
|
||||
* @property {Palette} [palette=Arne16] - [description]
|
||||
* @property {number} [pixelWidth=1] - [description]
|
||||
* @property {number} [pixelHeight=1] - [description]
|
||||
* @property {number} [pixelWidth=1] - The width of each 'pixel' in the generated texture.
|
||||
* @property {number} [pixelHeight=1] - The height of each 'pixel' in the generated texture.
|
||||
* @property {boolean} [resizeCanvas=true] - [description]
|
||||
* @property {boolean} [clearCanvas=true] - [description]
|
||||
* @property {GenerateTextureRendererCallback} [preRender] - [description]
|
||||
|
|
|
@ -8,15 +8,19 @@ var Class = require('../../utils/Class');
|
|||
|
||||
/**
|
||||
* @classdesc
|
||||
* [description]
|
||||
* A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect a visible pixel from the geometry mask. The mask is essentially a clipping path which can only make a masked pixel fully visible or fully invisible without changing its alpha (opacity).
|
||||
*
|
||||
* A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and alpha of the pixel from the Geometry Mask do not matter.
|
||||
*
|
||||
* The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. Moving or transforming the underlying Graphics object will change the mask (and affect the visibility of any masked objects), whereas moving or transforming a masked object will not affect the mask. You can think of the Geometry Mask (or rather, of the its Graphics object) as an invisible curtain placed in front of all masked objects which has its own visual properties and, naturally, respects the camera's visual properties, but isn't affected by and doesn't follow the masked objects by itself.
|
||||
*
|
||||
* @class GeometryMask
|
||||
* @memberOf Phaser.Display.Masks
|
||||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Scene} scene - [description]
|
||||
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description]
|
||||
* @param {Phaser.Scene} scene - This parameter is not used.
|
||||
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List.
|
||||
*/
|
||||
var GeometryMask = new Class({
|
||||
|
||||
|
@ -25,7 +29,7 @@ var GeometryMask = new Class({
|
|||
function GeometryMask (scene, graphicsGeometry)
|
||||
{
|
||||
/**
|
||||
* [description]
|
||||
* The Graphics object which describes the Geometry Mask.
|
||||
*
|
||||
* @name Phaser.Display.Masks.GeometryMask#geometryMask
|
||||
* @type {Phaser.GameObjects.Graphics}
|
||||
|
@ -35,12 +39,12 @@ var GeometryMask = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets a new Graphics object for the Geometry Mask.
|
||||
*
|
||||
* @method Phaser.Display.Masks.GeometryMask#setShape
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description]
|
||||
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask.
|
||||
*/
|
||||
setShape: function (graphicsGeometry)
|
||||
{
|
||||
|
@ -48,14 +52,14 @@ var GeometryMask = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask.
|
||||
*
|
||||
* @method Phaser.Display.Masks.GeometryMask#preRenderWebGL
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} mask - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to.
|
||||
* @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.
|
||||
*/
|
||||
preRenderWebGL: function (renderer, mask, camera)
|
||||
{
|
||||
|
@ -83,12 +87,12 @@ var GeometryMask = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it.
|
||||
*
|
||||
* @method Phaser.Display.Masks.GeometryMask#postRenderWebGL
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description]
|
||||
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush.
|
||||
*/
|
||||
postRenderWebGL: function (renderer)
|
||||
{
|
||||
|
@ -96,18 +100,19 @@ var GeometryMask = new Class({
|
|||
|
||||
// Force flush before disabling stencil test
|
||||
renderer.flush();
|
||||
|
||||
gl.disable(gl.STENCIL_TEST);
|
||||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object.
|
||||
*
|
||||
* @method Phaser.Display.Masks.GeometryMask#preRenderCanvas
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} mask - [description]
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
|
||||
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on.
|
||||
* @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered.
|
||||
* @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.
|
||||
*/
|
||||
preRenderCanvas: function (renderer, mask, camera)
|
||||
{
|
||||
|
@ -121,12 +126,12 @@ var GeometryMask = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Restore the canvas context's previous clipping path, thus turning off the mask for it.
|
||||
*
|
||||
* @method Phaser.Display.Masks.GeometryMask#postRenderCanvas
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description]
|
||||
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored.
|
||||
*/
|
||||
postRenderCanvas: function (renderer)
|
||||
{
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
var DistanceBetween = require('../../math/distance/DistanceBetween');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Checks if two Circles intersect.
|
||||
*
|
||||
* @function Phaser.Geom.Intersects.CircleToCircle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Geom.Circle} circleA - [description]
|
||||
* @param {Phaser.Geom.Circle} circleB - [description]
|
||||
* @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection.
|
||||
* @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the two Circles intersect, otherwise `false`.
|
||||
*/
|
||||
var CircleToCircle = function (circleA, circleB)
|
||||
{
|
||||
|
|
|
@ -10,16 +10,16 @@ var Point = require('../point/Point');
|
|||
// See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting.
|
||||
*
|
||||
* @function Phaser.Geom.Intersects.LineToLine
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Geom.Line} line1 - [description]
|
||||
* @param {Phaser.Geom.Line} line2 - [description]
|
||||
* @param {Phaser.Geom.Point} [out] - [description]
|
||||
* @param {Phaser.Geom.Line} line1 - The first Line to check.
|
||||
* @param {Phaser.Geom.Line} line2 - The second Line to check.
|
||||
* @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`.
|
||||
*/
|
||||
var LineToLine = function (line1, line2, out)
|
||||
{
|
||||
|
|
|
@ -8,15 +8,17 @@ var Contains = require('../triangle/Contains');
|
|||
var LineToLine = require('./LineToLine');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Checks if a Triangle and a Line intersect.
|
||||
*
|
||||
* The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid".
|
||||
*
|
||||
* @function Phaser.Geom.Intersects.TriangleToLine
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Geom.Triangle} triangle - [description]
|
||||
* @param {Phaser.Geom.Line} line - [description]
|
||||
* @param {Phaser.Geom.Triangle} triangle - The Triangle to check with.
|
||||
* @param {Phaser.Geom.Line} line - The Line to check with.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the Triangle and the Line intersect, otherwise `false`.
|
||||
*/
|
||||
var TriangleToLine = function (triangle, line)
|
||||
{
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Swaps the X and the Y coordinate of a point.
|
||||
*
|
||||
* @function Phaser.Geom.Point.Invert
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Point} O - [point,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Point} point - [description]
|
||||
* @param {Phaser.Geom.Point} point - The Point to modify.
|
||||
*
|
||||
* @return {Phaser.Geom.Point} [description]
|
||||
* @return {Phaser.Geom.Point} The modified `point`.
|
||||
*/
|
||||
var Invert = function (point)
|
||||
{
|
||||
|
|
|
@ -8,16 +8,16 @@
|
|||
// Adapted from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by Jonas Raoni Soares Silva
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Checks if a point is within the bounds of a Polygon.
|
||||
*
|
||||
* @function Phaser.Geom.Polygon.Contains
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Geom.Polygon} polygon - [description]
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {Phaser.Geom.Polygon} polygon - The Polygon to check against.
|
||||
* @param {number} x - The X coordinate of the point to check.
|
||||
* @param {number} y - The Y coordinate of the point to check.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the point is within the bounds of the Polygon, otherwise `false`.
|
||||
*/
|
||||
var Contains = function (polygon, x, y)
|
||||
{
|
||||
|
|
|
@ -7,17 +7,19 @@
|
|||
// Export the points as an array of flat numbers, following the sequence [ x,y, x,y, x,y ]
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ],
|
||||
* i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant
|
||||
* array for the point's X and Y coordinate.
|
||||
*
|
||||
* @function Phaser.Geom.Polygon.GetNumberArray
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {number[]} O - [output,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Polygon} polygon - [description]
|
||||
* @param {(array|number[])} [output] - [description]
|
||||
* @param {Phaser.Geom.Polygon} polygon - The Polygon whose points to export.
|
||||
* @param {(array|number[])} [output] - An array to which the points' coordinates should be appended.
|
||||
*
|
||||
* @return {(array|number[])} [description]
|
||||
* @return {(array|number[])} The modified `output` array, or a new array if none was given.
|
||||
*/
|
||||
var GetNumberArray = function (polygon, output)
|
||||
{
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Rounds a Rectangle's position up to the smallest integer greater than or equal to each current coordinate.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.Ceil
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [rect,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} rect - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The adjusted Rectangle.
|
||||
*/
|
||||
var Ceil = function (rect)
|
||||
{
|
||||
|
|
|
@ -7,18 +7,18 @@
|
|||
// Centers this Rectangle so that the center coordinates match the given x and y values.
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Moves the top-left corner of a Rectangle so that its center is at the given coordinates.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.CenterOn
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [rect,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} rect - [description]
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to be centered.
|
||||
* @param {number} x - The X coordinate of the Rectangle's center.
|
||||
* @param {number} y - The Y coordinate of the Rectangle's center.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The centered rectangle.
|
||||
*/
|
||||
var CenterOn = function (rect, x, y)
|
||||
{
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
var Rectangle = require('./Rectangle');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Creates a new Rectangle which is identical to the given one.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.Clone
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} source - [description]
|
||||
* @param {Phaser.Geom.Rectangle} source - The Rectangle to clone.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The newly created Rectangle, which is separate from the given one.
|
||||
*/
|
||||
var Clone = function (source)
|
||||
{
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Rounds a Rectangle's position and size down to the largest integer less than or equal to each current coordinate or dimension.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.FloorAll
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [rect,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} rect - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The adjusted Rectangle.
|
||||
*/
|
||||
var FloorAll = function (rect)
|
||||
{
|
||||
|
|
|
@ -15,17 +15,17 @@ var Rectangle = require('./Rectangle');
|
|||
// ]
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Constructs new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.FromPoints
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [out,$return]
|
||||
*
|
||||
* @param {array} points - [description]
|
||||
* @param {Phaser.Geom.Rectangle} [out] - [description]
|
||||
* @param {array} points - An array of points (either arrays with two elements corresponding to the X and Y coordinate or an object with public `x` and `y` properties) which should be surrounded by the Rectangle.
|
||||
* @param {Phaser.Geom.Rectangle} [out] - Optional Rectangle to adjust.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The adjusted `out` Rectangle, or a new Rectangle if none was provided.
|
||||
*/
|
||||
var FromPoints = function (points, out)
|
||||
{
|
||||
|
|
|
@ -6,20 +6,18 @@
|
|||
|
||||
var Point = require('../point/Point');
|
||||
|
||||
// The center of the Rectangle object, expressed as a Point object
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Returns the center of a Rectangle as a Point.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.GetCenter
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Point} O - [out,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} rect - [description]
|
||||
* @param {(Phaser.Geom.Point|object)} [out] - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the center of.
|
||||
* @param {(Phaser.Geom.Point|object)} [out] - Optional point-like object to update with the center coordinates.
|
||||
*
|
||||
* @return {(Phaser.Geom.Point|object)} [description]
|
||||
* @return {(Phaser.Geom.Point|object)} The modified `out` object, or a new Point if none was provided.
|
||||
*/
|
||||
var GetCenter = function (rect, out)
|
||||
{
|
||||
|
|
|
@ -4,21 +4,18 @@
|
|||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||
*/
|
||||
|
||||
// Merges the target Rectangle with a list of points.
|
||||
// The points is an array of objects with public x/y properties.
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.MergePoints
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [target,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} target - [description]
|
||||
* @param {Phaser.Geom.Point[]} points - [description]
|
||||
* @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged.
|
||||
* @param {Phaser.Geom.Point[]} points - An array of Points (or any object with public `x` and `y` properties) which should be merged with the Rectangle.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The modified Rectangle.
|
||||
*/
|
||||
var MergePoints = function (target, points)
|
||||
{
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Merges a Rectangle with a point by repositioning and/or resizing it so that the point is on or within its bounds.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.MergeXY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [target,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} target - [description]
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {Phaser.Geom.Rectangle} target - The Rectangle which should be merged and modified.
|
||||
* @param {number} x - The X coordinate of the point which should be merged.
|
||||
* @param {number} y - The Y coordinate of the point which should be merged.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The modified `target` Rectangle.
|
||||
*/
|
||||
var MergeXY = function (target, x, y)
|
||||
{
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Nudges (translates) the top left corner of a Rectangle by a given offset.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.Offset
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [rect,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} rect - [description]
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.
|
||||
* @param {number} x - The distance to move the Rectangle horizontally.
|
||||
* @param {number} y - The distance to move the Rectangle vertically.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The adjusted Rectangle.
|
||||
*/
|
||||
var Offset = function (rect, x, y)
|
||||
{
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Nudges (translates) the top-left corner of a Rectangle by the coordinates of a point (translation vector).
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.OffsetPoint
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [rect,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} rect - [description]
|
||||
* @param {Phaser.Geom.Point} point - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to adjust.
|
||||
* @param {(Phaser.Geom.Point|Phaser.Math.Vector2)} point - The point whose coordinates should be used as an offset.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The adjusted Rectangle.
|
||||
*/
|
||||
var OffsetPoint = function (rect, point)
|
||||
{
|
||||
|
|
|
@ -7,17 +7,17 @@
|
|||
var Point = require('../point/Point');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Returns a random point within a Rectangle.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.Random
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Point} O - [out,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} rect - [description]
|
||||
* @param {Phaser.Geom.Point} out - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rect - The Rectangle to return a point from.
|
||||
* @param {Phaser.Geom.Point} out - The object to update with the point's coordinates.
|
||||
*
|
||||
* @return {Phaser.Geom.Point} [description]
|
||||
* @return {Phaser.Geom.Point} The modified `out` object, or a new Point if none was provided.
|
||||
*/
|
||||
var Random = function (rect, out)
|
||||
{
|
||||
|
|
|
@ -20,10 +20,10 @@ var Random = require('./Random');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [x=0] - [description]
|
||||
* @param {number} [y=0] - [description]
|
||||
* @param {number} [width=0] - [description]
|
||||
* @param {number} [height=0] - [description]
|
||||
* @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle.
|
||||
* @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle.
|
||||
* @param {number} [width=0] - The width of the Rectangle.
|
||||
* @param {number} [height=0] - The height of the Rectangle.
|
||||
*/
|
||||
var Rectangle = new Class({
|
||||
|
||||
|
@ -37,7 +37,7 @@ var Rectangle = new Class({
|
|||
if (height === undefined) { height = 0; }
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The X coordinate of the top left corner of the Rectangle.
|
||||
*
|
||||
* @name Phaser.Geom.Rectangle#x
|
||||
* @type {number}
|
||||
|
@ -47,7 +47,7 @@ var Rectangle = new Class({
|
|||
this.x = x;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Y coordinate of the top left corner of the Rectangle.
|
||||
*
|
||||
* @name Phaser.Geom.Rectangle#y
|
||||
* @type {number}
|
||||
|
@ -57,7 +57,7 @@ var Rectangle = new Class({
|
|||
this.y = y;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side.
|
||||
*
|
||||
* @name Phaser.Geom.Rectangle#width
|
||||
* @type {number}
|
||||
|
@ -67,7 +67,7 @@ var Rectangle = new Class({
|
|||
this.width = width;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side.
|
||||
*
|
||||
* @name Phaser.Geom.Rectangle#height
|
||||
* @type {number}
|
||||
|
@ -78,15 +78,15 @@ var Rectangle = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Checks if the given point is inside the Rectangle's bounds.
|
||||
*
|
||||
* @method Phaser.Geom.Rectangle#contains
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {number} x - The X coordinate of the point to check.
|
||||
* @param {number} y - The Y coordinate of the point to check.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`.
|
||||
*/
|
||||
contains: function (x, y)
|
||||
{
|
||||
|
@ -94,17 +94,21 @@ var Rectangle = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter.
|
||||
*
|
||||
* The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is.
|
||||
*
|
||||
* A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side.
|
||||
*
|
||||
* @method Phaser.Geom.Rectangle#getPoint
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Point} O - [output,$return]
|
||||
*
|
||||
* @param {number} position - [description]
|
||||
* @param {(Phaser.Geom.Point|object)} [output] - [description]
|
||||
* @param {number} position - The normalized distance into the Rectangle's perimeter to return.
|
||||
* @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point.
|
||||
*
|
||||
* @return {(Phaser.Geom.Point|object)} [description]
|
||||
* @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given.
|
||||
*/
|
||||
getPoint: function (position, output)
|
||||
{
|
||||
|
@ -112,18 +116,18 @@ var Rectangle = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required.
|
||||
*
|
||||
* @method Phaser.Geom.Rectangle#getPoints
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Point[]} O - [output,$return]
|
||||
*
|
||||
* @param {integer} quantity - [description]
|
||||
* @param {number} [stepRate] - [description]
|
||||
* @param {(array|Phaser.Geom.Point[])} [output] - [description]
|
||||
* @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`.
|
||||
* @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point.
|
||||
* @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points.
|
||||
*
|
||||
* @return {(array|Phaser.Geom.Point[])} [description]
|
||||
* @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided.
|
||||
*/
|
||||
getPoints: function (quantity, stepRate, output)
|
||||
{
|
||||
|
@ -131,16 +135,16 @@ var Rectangle = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Returns a random point within the Rectangle's bounds.
|
||||
*
|
||||
* @method Phaser.Geom.Rectangle#getRandomPoint
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Point} O - [point,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Point} [point] - [description]
|
||||
* @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point.
|
||||
*
|
||||
* @return {Phaser.Geom.Point} [description]
|
||||
* @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided.
|
||||
*/
|
||||
getRandomPoint: function (point)
|
||||
{
|
||||
|
@ -148,15 +152,15 @@ var Rectangle = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the position, width, and height of the Rectangle.
|
||||
*
|
||||
* @method Phaser.Geom.Rectangle#setTo
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {number} width - [description]
|
||||
* @param {number} height - [description]
|
||||
* @param {number} x - The X coordinate of the top left corner of the Rectangle.
|
||||
* @param {number} y - The Y coordinate of the top left corner of the Rectangle.
|
||||
* @param {number} width - The width of the Rectangle.
|
||||
* @param {number} height - The height of the Rectangle.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} This Rectangle object.
|
||||
*/
|
||||
|
@ -171,7 +175,7 @@ var Rectangle = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Resets the position, width, and height of the Rectangle to 0.
|
||||
*
|
||||
* @method Phaser.Geom.Rectangle#setEmpty
|
||||
* @since 3.0.0
|
||||
|
@ -184,13 +188,13 @@ var Rectangle = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the position of the Rectangle.
|
||||
*
|
||||
* @method Phaser.Geom.Rectangle#setPosition
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} [y=x] - [description]
|
||||
* @param {number} x - The X coordinate of the top left corner of the Rectangle.
|
||||
* @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} This Rectangle object.
|
||||
*/
|
||||
|
|
|
@ -7,18 +7,18 @@
|
|||
var Rectangle = require('./Rectangle');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union.
|
||||
*
|
||||
* @function Phaser.Geom.Rectangle.Union
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Rectangle} O - [out,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Rectangle} rectA - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rectB - [description]
|
||||
* @param {Phaser.Geom.Rectangle} [out] - [description]
|
||||
* @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use.
|
||||
* @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use.
|
||||
* @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in.
|
||||
*
|
||||
* @return {Phaser.Geom.Rectangle} [description]
|
||||
* @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided.
|
||||
*/
|
||||
var Union = function (rectA, rectB, out)
|
||||
{
|
||||
|
|
|
@ -11,17 +11,17 @@ var Triangle = require('./Triangle');
|
|||
// w/h can be positive or negative and represent the length of each side
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Builds a right triangle, i.e. one which has a 90-degree angle and two acute angles.
|
||||
*
|
||||
* @function Phaser.Geom.Triangle.BuildRight
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - [description]
|
||||
* @param {number} y - [description]
|
||||
* @param {number} width - [description]
|
||||
* @param {number} height - [description]
|
||||
* @param {number} x - The X coordinate of the right angle, which will also be the first X coordinate of the constructed Triangle.
|
||||
* @param {number} y - The Y coordinate of the right angle, which will also be the first Y coordinate of the constructed Triangle.
|
||||
* @param {number} width - The length of the side which is to the left or to the right of the right angle.
|
||||
* @param {number} height - The length of the side which is above or below the right angle.
|
||||
*
|
||||
* @return {Phaser.Geom.Triangle} [description]
|
||||
* @return {Phaser.Geom.Triangle} The constructed right Triangle.
|
||||
*/
|
||||
var BuildRight = function (x, y, width, height)
|
||||
{
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Returns true if two triangles have the same coordinates.
|
||||
*
|
||||
* @function Phaser.Geom.Triangle.Equals
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Geom.Triangle} triangle - [description]
|
||||
* @param {Phaser.Geom.Triangle} toCompare - [description]
|
||||
* @param {Phaser.Geom.Triangle} triangle - The first triangle to check.
|
||||
* @param {Phaser.Geom.Triangle} toCompare - The second triangle to check.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the two given triangles have the exact same coordinates, otherwise `false`.
|
||||
*/
|
||||
var Equals = function (triangle, toCompare)
|
||||
{
|
||||
|
|
|
@ -8,19 +8,19 @@ var Length = require('../line/Length');
|
|||
var Point = require('../point/Point');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Returns an array of evenly spaced points on the perimeter of a Triangle.
|
||||
*
|
||||
* @function Phaser.Geom.Triangle.GetPoints
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @generic {Phaser.Geom.Point} O - [out,$return]
|
||||
*
|
||||
* @param {Phaser.Geom.Triangle} triangle - [description]
|
||||
* @param {integer} quantity - [description]
|
||||
* @param {number} stepRate - [description]
|
||||
* @param {(array|Phaser.Geom.Point[])} [out] - [description]
|
||||
* @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from.
|
||||
* @param {integer} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`.
|
||||
* @param {number} stepRate - If `quantity` is 0, the distance between each returned point.
|
||||
* @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended.
|
||||
*
|
||||
* @return {(array|Phaser.Geom.Point[])} [description]
|
||||
* @return {(array|Phaser.Geom.Point[])} The modified `out` array, or a new array if none was provided.
|
||||
*/
|
||||
var GetPoints = function (triangle, quantity, stepRate, out)
|
||||
{
|
||||
|
|
|
@ -107,13 +107,13 @@ var Vector3 = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Calculate the cross (vector) product of two given Vectors.
|
||||
*
|
||||
* @method Phaser.Math.Vector3#crossVectors
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Math.Vector3} a - [description]
|
||||
* @param {Phaser.Math.Vector3} b - [description]
|
||||
* @param {Phaser.Math.Vector3} a - The first Vector to multiply.
|
||||
* @param {Phaser.Math.Vector3} b - The second Vector to multiply.
|
||||
*
|
||||
* @return {Phaser.Math.Vector3} This Vector3.
|
||||
*/
|
||||
|
@ -433,7 +433,7 @@ var Vector3 = new Class({
|
|||
*
|
||||
* @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3.
|
||||
*
|
||||
* @return {number} [description]
|
||||
* @return {number} The dot product of this Vector and `v`.
|
||||
*/
|
||||
dot: function (v)
|
||||
{
|
||||
|
@ -441,12 +441,12 @@ var Vector3 = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector.
|
||||
*
|
||||
* @method Phaser.Math.Vector3#cross
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Math.Vector3} v - [description]
|
||||
* @param {Phaser.Math.Vector3} v - The Vector to cross product with.
|
||||
*
|
||||
* @return {Phaser.Math.Vector3} This Vector3.
|
||||
*/
|
||||
|
|
|
@ -1814,7 +1814,7 @@ var World = new Class({
|
|||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {*} callbackContext - [description]
|
||||
* @param {boolean} overlapOnly - [description]
|
||||
* @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.
|
||||
*/
|
||||
|
@ -1884,7 +1884,7 @@ var World = new Class({
|
|||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {*} callbackContext - [description]
|
||||
* @param {boolean} overlapOnly - [description]
|
||||
* @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.
|
||||
*/
|
||||
|
@ -1962,7 +1962,7 @@ var World = new Class({
|
|||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {*} callbackContext - [description]
|
||||
* @param {boolean} overlapOnly - [description]
|
||||
* @param {boolean} overlapOnly - Whether this is a collision or overlap check.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
*/
|
||||
|
@ -1997,7 +1997,7 @@ var World = new Class({
|
|||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {*} callbackContext - [description]
|
||||
* @param {boolean} overlapOnly - [description]
|
||||
* @param {boolean} overlapOnly - Whether this is a collision or overlap check.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
*/
|
||||
|
@ -2090,7 +2090,7 @@ var World = new Class({
|
|||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {*} callbackContext - [description]
|
||||
* @param {boolean} overlapOnly - [description]
|
||||
* @param {boolean} overlapOnly - Whether this is a collision or overlap check.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
*/
|
||||
|
@ -2132,7 +2132,7 @@ var World = new Class({
|
|||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {*} callbackContext - [description]
|
||||
* @param {boolean} overlapOnly - [description]
|
||||
* @param {boolean} overlapOnly - Whether this is a collision or overlap check.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
*/
|
||||
|
@ -2234,7 +2234,7 @@ var World = new Class({
|
|||
* @param {ArcadePhysicsCallback} collideCallback - [description]
|
||||
* @param {ArcadePhysicsCallback} processCallback - [description]
|
||||
* @param {*} callbackContext - [description]
|
||||
* @param {boolean} overlapOnly - [description]
|
||||
* @param {boolean} overlapOnly - Whether this is a collision or overlap check.
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
*/
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Takes a snapshot of the current frame displayed by a WebGL canvas.
|
||||
*
|
||||
* @function Phaser.Renderer.Snapshot.WebGL
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {HTMLCanvasElement} sourceCanvas - [description]
|
||||
* @param {string} [type='image/png'] - [description]
|
||||
* @param {number} [encoderOptions=0.92] - [description]
|
||||
* @param {HTMLCanvasElement} sourceCanvas - The canvas to take a snapshot of.
|
||||
* @param {string} [type='image/png'] - The format of the returned image.
|
||||
* @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1, for image formats which use lossy compression (such as `image/jpeg`).
|
||||
*
|
||||
* @return {HTMLImageElement} [description]
|
||||
* @return {HTMLImageElement} A new image which contains a snapshot of the canvas's contents.
|
||||
*/
|
||||
var WebGLSnapshot = function (sourceCanvas, type, encoderOptions)
|
||||
{
|
||||
|
|
|
@ -22,15 +22,15 @@ var TextureTintPipeline = require('./pipelines/TextureTintPipeline');
|
|||
/**
|
||||
* @callback WebGLContextCallback
|
||||
*
|
||||
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description]
|
||||
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer which owns the context.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} SnapshotState
|
||||
*
|
||||
* @property {SnapshotCallback} callback - [description]
|
||||
* @property {string} type - [description]
|
||||
* @property {number} encoder - [description]
|
||||
* @property {SnapshotCallback} callback - The function to call after the snapshot is taken.
|
||||
* @property {string} type - The type of the image to create.
|
||||
* @property {number} encoder - The image quality, between 0 and 1, for image formats which use lossy compression (such as `image/jpeg`).
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ var TextureTintPipeline = require('./pipelines/TextureTintPipeline');
|
|||
* @constructor
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Game} game - [description]
|
||||
* @param {Phaser.Game} game - The Game instance which owns this WebGL Renderer.
|
||||
*/
|
||||
var WebGLRenderer = new Class({
|
||||
|
||||
|
@ -73,7 +73,7 @@ var WebGLRenderer = new Class({
|
|||
};
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The local configuration settings of this WebGL Renderer.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#config
|
||||
* @type {RendererConfig}
|
||||
|
@ -93,7 +93,7 @@ var WebGLRenderer = new Class({
|
|||
};
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The Game instance which owns this WebGL Renderer.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#game
|
||||
* @type {Phaser.Game}
|
||||
|
@ -102,7 +102,7 @@ var WebGLRenderer = new Class({
|
|||
this.game = game;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* A constant which allows the renderer to be easily identified as a WebGL Renderer.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#type
|
||||
* @type {integer}
|
||||
|
@ -111,7 +111,7 @@ var WebGLRenderer = new Class({
|
|||
this.type = CONST.WEBGL;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The width of a rendered frame.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#width
|
||||
* @type {number}
|
||||
|
@ -120,7 +120,7 @@ var WebGLRenderer = new Class({
|
|||
this.width = game.config.width;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The height of a rendered frame.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#height
|
||||
* @type {number}
|
||||
|
@ -129,7 +129,7 @@ var WebGLRenderer = new Class({
|
|||
this.height = game.config.height;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The canvas which this WebGL Renderer draws to.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#canvas
|
||||
* @type {HTMLCanvasElement}
|
||||
|
@ -138,7 +138,7 @@ var WebGLRenderer = new Class({
|
|||
this.canvas = game.canvas;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* An array of functions to invoke if the WebGL context is lost.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#lostContextCallbacks
|
||||
* @type {WebGLContextCallback[]}
|
||||
|
@ -147,7 +147,7 @@ var WebGLRenderer = new Class({
|
|||
this.lostContextCallbacks = [];
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* An array of functions to invoke if the WebGL context is restored.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#restoredContextCallbacks
|
||||
* @type {WebGLContextCallback[]}
|
||||
|
@ -156,7 +156,9 @@ var WebGLRenderer = new Class({
|
|||
this.restoredContextCallbacks = [];
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* An array of blend modes supported by the WebGL Renderer.
|
||||
*
|
||||
* This array includes the default blend modes as well as any custom blend modes added through {@link #addBlendMode}.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#blendModes
|
||||
* @type {array}
|
||||
|
@ -176,7 +178,7 @@ var WebGLRenderer = new Class({
|
|||
this.nativeTextures = [];
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Set to `true` if the WebGL context of the renderer is lost.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#contextLost
|
||||
* @type {boolean}
|
||||
|
@ -196,7 +198,9 @@ var WebGLRenderer = new Class({
|
|||
this.pipelines = null;
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Details about the currently scheduled snapshot.
|
||||
*
|
||||
* If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#snapshotState
|
||||
* @type {SnapshotState}
|
||||
|
@ -344,7 +348,7 @@ var WebGLRenderer = new Class({
|
|||
// These are initialized post context creation
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The underlying WebGL context of the renderer.
|
||||
*
|
||||
* @name Phaser.Renderer.WebGL.WebGLRenderer#gl
|
||||
* @type {WebGLRenderingContext}
|
||||
|
@ -469,7 +473,7 @@ var WebGLRenderer = new Class({
|
|||
* @method Phaser.Renderer.WebGL.WebGLRenderer#init
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} config - [description]
|
||||
* @param {object} config - The configuration object for the renderer.
|
||||
*
|
||||
* @return {this} This WebGLRenderer instance.
|
||||
*/
|
||||
|
@ -695,7 +699,7 @@ var WebGLRenderer = new Class({
|
|||
* @method Phaser.Renderer.WebGL.WebGLRenderer#getExtension
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {string} extensionName - [description]
|
||||
* @param {string} extensionName - The name of the extension to load.
|
||||
*
|
||||
* @return {object} WebGL extension if the extension is supported
|
||||
*/
|
||||
|
@ -959,15 +963,15 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Creates a new custom blend mode for the renderer.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#addBlendMode
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {function} func - [description]
|
||||
* @param {function} equation - [description]
|
||||
* @param {function} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}.
|
||||
* @param {function} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}.
|
||||
*
|
||||
* @return {integer} [description]
|
||||
* @return {integer} The index of the new blend mode, used for referencing it in the future.
|
||||
*/
|
||||
addBlendMode: function (func, equation)
|
||||
{
|
||||
|
@ -1779,16 +1783,16 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Schedules a snapshot to be taken after the current frame is rendered.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#snapshot
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {SnapshotCallback} callback - [description]
|
||||
* @param {string} type - [description]
|
||||
* @param {number} encoderOptions - [description]
|
||||
* @param {SnapshotCallback} callback - Function to invoke after the snapshot is created.
|
||||
* @param {string} type - The format of the image to create, usually `image/png`.
|
||||
* @param {number} encoderOptions - The image quality, between 0 and 1, to use for image formats with lossy compression (such as `image/jpeg`).
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} This WebGL Renderer.
|
||||
*/
|
||||
snapshot: function (callback, type, encoderOptions)
|
||||
{
|
||||
|
@ -1832,13 +1836,13 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the minification and magnification filter for a texture.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {integer} texture - [description]
|
||||
* @param {integer} filter - [description]
|
||||
* @param {integer} texture - The texture to set the filter for.
|
||||
* @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering.
|
||||
*
|
||||
* @return {this} This WebGL Renderer instance.
|
||||
*/
|
||||
|
|
|
@ -13,13 +13,13 @@ var StableSort = require('../utils/array/StableSort');
|
|||
* @callback EachListCallback
|
||||
* @generic I - [item]
|
||||
*
|
||||
* @param {*} item - [description]
|
||||
* @param {*} item - The item which is currently being processed.
|
||||
* @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* [description]
|
||||
* List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items.
|
||||
*
|
||||
* @class List
|
||||
* @memberOf Phaser.Structs
|
||||
|
@ -28,7 +28,7 @@ var StableSort = require('../utils/array/StableSort');
|
|||
*
|
||||
* @generic T
|
||||
*
|
||||
* @param {*} parent - [description]
|
||||
* @param {*} parent - The parent of this list.
|
||||
*/
|
||||
var List = new Class({
|
||||
|
||||
|
@ -58,7 +58,9 @@ var List = new Class({
|
|||
this.list = [];
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The index of the current element.
|
||||
*
|
||||
* This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties.
|
||||
*
|
||||
* @name Phaser.Structs.List#position
|
||||
* @type {integer}
|
||||
|
@ -96,17 +98,17 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Adds the given item to the end of the list. Each item must be unique.
|
||||
*
|
||||
* @method Phaser.Structs.List#add
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [child,$return]
|
||||
*
|
||||
* @param {*|Array.<*>} child - [description]
|
||||
* @param {*|Array.<*>} child - The item, or array of items, to add to the list.
|
||||
* @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The list's underlying array.
|
||||
*/
|
||||
add: function (child, skipCallback)
|
||||
{
|
||||
|
@ -121,18 +123,18 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Adds an item to list, starting at a specified index. Each item must be unique within the list.
|
||||
*
|
||||
* @method Phaser.Structs.List#addAt
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [child,$return]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {integer} [index=0] - [description]
|
||||
* @param {*} child - The item, or array of items, to add to the list.
|
||||
* @param {integer} [index=0] - The index in the list at which the element(s) will be inserted.
|
||||
* @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The List's underlying array.
|
||||
*/
|
||||
addAt: function (child, index, skipCallback)
|
||||
{
|
||||
|
@ -147,16 +149,16 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Retrieves the item at a given position inside the List.
|
||||
*
|
||||
* @method Phaser.Structs.List#getAt
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [$return]
|
||||
*
|
||||
* @param {integer} index - [description]
|
||||
* @param {integer} index - The index of the item.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The retrieved item, or `undefined` if it's outside the List's bounds.
|
||||
*/
|
||||
getAt: function (index)
|
||||
{
|
||||
|
@ -164,16 +166,16 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Locates an item within the List and returns its index.
|
||||
*
|
||||
* @method Phaser.Structs.List#getIndex
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [child]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {*} child - The item to locate.
|
||||
*
|
||||
* @return {integer} [description]
|
||||
* @return {integer} The index of the item within the List, or -1 if it's not in the List.
|
||||
*/
|
||||
getIndex: function (child)
|
||||
{
|
||||
|
@ -193,7 +195,7 @@ var List = new Class({
|
|||
*
|
||||
* @param {string} property - The property to lexically sort by.
|
||||
*
|
||||
* @return {Array.<*>} [description]
|
||||
* @return {Phaser.Structs.List} This List object.
|
||||
*/
|
||||
sort: function (property)
|
||||
{
|
||||
|
@ -208,7 +210,7 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Internal handler for the {@link #sort} method which compares two items.
|
||||
*
|
||||
* @method Phaser.Structs.List#sortHandler
|
||||
* @private
|
||||
|
@ -216,10 +218,10 @@ var List = new Class({
|
|||
*
|
||||
* @genericUse {T} - [childA,childB]
|
||||
*
|
||||
* @param {*} childA - [description]
|
||||
* @param {*} childB - [description]
|
||||
* @param {*} childA - The first item to compare.
|
||||
* @param {*} childB - The second item to compare.
|
||||
*
|
||||
* @return {integer} [description]
|
||||
* @return {integer} The result of the comparison, which will be negative if the first item is smaller then second, positive if the first item is larger than the second, or 0 if they're equal.
|
||||
*/
|
||||
sortHandler: function (childA, childB)
|
||||
{
|
||||
|
@ -264,7 +266,7 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Returns the first element in a given part of the List which matches a specific criterion.
|
||||
*
|
||||
* @method Phaser.Structs.List#getFirst
|
||||
* @since 3.0.0
|
||||
|
@ -272,12 +274,12 @@ var List = new Class({
|
|||
* @genericUse {T} - [value]
|
||||
* @genericUse {T | null} - [$return]
|
||||
*
|
||||
* @param {string} property - [description]
|
||||
* @param {*} value - [description]
|
||||
* @param {number} [startIndex=0] - [description]
|
||||
* @param {number} [endIndex] - [description]
|
||||
* @param {string} property - The name of the property to test or a falsey value to have no criterion.
|
||||
* @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence.
|
||||
* @param {number} [startIndex=0] - The position in the List to start the search at.
|
||||
* @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked.
|
||||
*
|
||||
* @return {?*} [description]
|
||||
* @return {?*} The first item which matches the given criterion, or `null` if no such item exists.
|
||||
*/
|
||||
getFirst: function (property, value, startIndex, endIndex)
|
||||
{
|
||||
|
@ -310,7 +312,7 @@ var List = new Class({
|
|||
* @param {integer} [startIndex] - The first child index to start the search from.
|
||||
* @param {integer} [endIndex] - The last child index to search up until.
|
||||
*
|
||||
* @return {Array.<*>} [description]
|
||||
* @return {Array.<*>} All items of the List which match the given criterion, if any.
|
||||
*/
|
||||
getAll: function (property, value, startIndex, endIndex)
|
||||
{
|
||||
|
@ -318,17 +320,17 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Returns the total number of items in the List which have a property matching the given value.
|
||||
*
|
||||
* @method Phaser.Structs.List#count
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [value]
|
||||
*
|
||||
* @param {string} property - [description]
|
||||
* @param {*} value - [description]
|
||||
* @param {string} property - The property to test on each item.
|
||||
* @param {*} value - The value to test the property against.
|
||||
*
|
||||
* @return {integer} [description]
|
||||
* @return {integer} The total number of matching elements.
|
||||
*/
|
||||
count: function (property, value)
|
||||
{
|
||||
|
@ -336,15 +338,15 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Swaps the positions of two items in the list.
|
||||
*
|
||||
* @method Phaser.Structs.List#swap
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [child1,child2]
|
||||
*
|
||||
* @param {*} child1 - [description]
|
||||
* @param {*} child2 - [description]
|
||||
* @param {*} child1 - The first item to swap.
|
||||
* @param {*} child2 - The second item to swap.
|
||||
*/
|
||||
swap: function (child1, child2)
|
||||
{
|
||||
|
@ -352,17 +354,17 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Moves an item in the List to a new position.
|
||||
*
|
||||
* @method Phaser.Structs.List#moveTo
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [child,$return]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {integer} index - [description]
|
||||
* @param {*} child - The item to move.
|
||||
* @param {integer} index - Moves an item in the List to a new position.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The item that was moved.
|
||||
*/
|
||||
moveTo: function (child, index)
|
||||
{
|
||||
|
@ -370,17 +372,17 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Removes one or many items from the List.
|
||||
*
|
||||
* @method Phaser.Structs.List#remove
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [child,$return]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {*} child - The item, or array of items, to remove.
|
||||
* @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The item, or array of items, which were successfully removed from the List.
|
||||
*/
|
||||
remove: function (child, skipCallback)
|
||||
{
|
||||
|
@ -395,17 +397,17 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Removes the item at the given position in the List.
|
||||
*
|
||||
* @method Phaser.Structs.List#removeAt
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [$return]
|
||||
*
|
||||
* @param {integer} index - [description]
|
||||
* @param {integer} index - The position to remove the item from.
|
||||
* @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The item that was removed.
|
||||
*/
|
||||
removeAt: function (index, skipCallback)
|
||||
{
|
||||
|
@ -420,18 +422,18 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Removes the items within the given range in the List.
|
||||
*
|
||||
* @method Phaser.Structs.List#removeBetween
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T[]} - [$return]
|
||||
*
|
||||
* @param {integer} [startIndex=0] - [description]
|
||||
* @param {integer} [endIndex] - [description]
|
||||
* @param {integer} [startIndex=0] - The index to start removing from.
|
||||
* @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed.
|
||||
* @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback.
|
||||
*
|
||||
* @return {Array.<*>} [description]
|
||||
* @return {Array.<*>} An array of the items which were removed.[description]
|
||||
*/
|
||||
removeBetween: function (startIndex, endIndex, skipCallback)
|
||||
{
|
||||
|
@ -477,9 +479,9 @@ var List = new Class({
|
|||
*
|
||||
* @genericUse {T} - [child,$return]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {*} child - The item to bring to the top of the List.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The item which was moved.
|
||||
*/
|
||||
bringToTop: function (child)
|
||||
{
|
||||
|
@ -494,9 +496,9 @@ var List = new Class({
|
|||
*
|
||||
* @genericUse {T} - [child,$return]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {*} child - The item to send to the back of the list.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The item which was moved.
|
||||
*/
|
||||
sendToBack: function (child)
|
||||
{
|
||||
|
@ -511,9 +513,9 @@ var List = new Class({
|
|||
*
|
||||
* @genericUse {T} - [child,$return]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {*} child - The item to move up.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The item which was moved.
|
||||
*/
|
||||
moveUp: function (child)
|
||||
{
|
||||
|
@ -530,9 +532,9 @@ var List = new Class({
|
|||
*
|
||||
* @genericUse {T} - [child,$return]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {*} child - The item to move down.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The item which was moved.
|
||||
*/
|
||||
moveDown: function (child)
|
||||
{
|
||||
|
@ -559,7 +561,7 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Shuffles the items in the list.
|
||||
*
|
||||
* @method Phaser.Structs.List#shuffle
|
||||
* @since 3.0.0
|
||||
|
@ -594,16 +596,16 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Checks if an item exists within the List.
|
||||
*
|
||||
* @method Phaser.Structs.List#exists
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @genericUse {T} - [child]
|
||||
*
|
||||
* @param {*} child - [description]
|
||||
* @param {*} child - The item to check for the existence of.
|
||||
*
|
||||
* @return {boolean} True if the item is found in the list, otherwise false.
|
||||
* @return {boolean} `true` if the item is found in the list, otherwise `false`.
|
||||
*/
|
||||
exists: function (child)
|
||||
{
|
||||
|
@ -618,8 +620,8 @@ var List = new Class({
|
|||
*
|
||||
* @genericUse {T} - [value]
|
||||
*
|
||||
* @param {string} property - [description]
|
||||
* @param {*} value - [description]
|
||||
* @param {string} property - The name of the property to set.
|
||||
* @param {*} value - The value to set the property to.
|
||||
* @param {integer} [startIndex] - The first child index to start the search from.
|
||||
* @param {integer} [endIndex] - The last child index to search up until.
|
||||
*/
|
||||
|
@ -660,7 +662,7 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Clears the List and recreates its internal array.
|
||||
*
|
||||
* @method Phaser.Structs.List#shutdown
|
||||
* @since 3.0.0
|
||||
|
@ -688,7 +690,7 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The number of items inside the List.
|
||||
*
|
||||
* @name Phaser.Structs.List#length
|
||||
* @type {integer}
|
||||
|
@ -705,7 +707,7 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The first item in the List or `null` for an empty List.
|
||||
*
|
||||
* @name Phaser.Structs.List#first
|
||||
* @type {integer}
|
||||
|
@ -731,7 +733,7 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The last item in the List, or `null` for an empty List.
|
||||
*
|
||||
* @name Phaser.Structs.List#last
|
||||
* @type {integer}
|
||||
|
@ -757,7 +759,9 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The next item in the List, or `null` if the entire List has been traversed.
|
||||
*
|
||||
* This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List.
|
||||
*
|
||||
* @name Phaser.Structs.List#next
|
||||
* @type {integer}
|
||||
|
@ -783,7 +787,9 @@ var List = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* The previous item in the List, or `null` if the entire List has been traversed.
|
||||
*
|
||||
* This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards.
|
||||
*
|
||||
* @name Phaser.Structs.List#previous
|
||||
* @type {integer}
|
||||
|
|
|
@ -33,7 +33,7 @@ var ParseWeltmeister = require('./impact/ParseWeltmeister');
|
|||
* consumption. However if your map is small or you need to update the tiles dynamically, then leave
|
||||
* the default value set.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.MapData} [description]
|
||||
* @return {Phaser.Tilemaps.MapData} The created `MapData` object.
|
||||
*/
|
||||
var Parse = function (name, mapFormat, data, tileWidth, tileHeight, insertNull)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ var Parse2DArray = require('./Parse2DArray');
|
|||
* consumption. However if your map is small or you need to update the tiles dynamically, then leave
|
||||
* the default value set.
|
||||
*
|
||||
* @return {Phaser.Tilemaps.MapData} [description]
|
||||
* @return {Phaser.Tilemaps.MapData} The resulting MapData object.
|
||||
*/
|
||||
var ParseCSV = function (name, data, tileWidth, tileHeight, insertNull)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ var AssignTileProperties = require('./AssignTileProperties');
|
|||
* consumption. However if your map is small or you need to update the tiles dynamically, then leave
|
||||
* the default value set.
|
||||
*
|
||||
* @return {?Phaser.Tilemaps.MapData} [description]
|
||||
* @return {?Phaser.Tilemaps.MapData} The created MapData object, or `null` if the data can't be parsed.
|
||||
*/
|
||||
var ParseJSONTiled = function (name, json, insertNull)
|
||||
{
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Retrieves the value of the given key from an object.
|
||||
*
|
||||
* @function Phaser.Tweens.Builders.GetBoolean
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} source - [description]
|
||||
* @param {string} key - [description]
|
||||
* @param {*} defaultValue - [description]
|
||||
* @param {object} source - The object to retrieve the value from.
|
||||
* @param {string} key - The key to look for in the `source` object.
|
||||
* @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The retrieved value.
|
||||
*/
|
||||
var GetBoolean = function (source, key, defaultValue)
|
||||
{
|
||||
|
|
|
@ -327,12 +327,12 @@ var Tween = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Checks if the Tween is currently active.
|
||||
*
|
||||
* @method Phaser.Tweens.Tween#isPlaying
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the Tween is active, otherwise `false`.
|
||||
*/
|
||||
isPlaying: function ()
|
||||
{
|
||||
|
@ -340,12 +340,12 @@ var Tween = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Checks if the Tween is currently paused.
|
||||
*
|
||||
* @method Phaser.Tweens.Tween#isPaused
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {boolean} [description]
|
||||
* @return {boolean} `true` if the Tween is paused, otherwise `false`.
|
||||
*/
|
||||
isPaused: function ()
|
||||
{
|
||||
|
@ -723,7 +723,7 @@ var Tween = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Resumes the playback of a previously paused Tween.
|
||||
*
|
||||
* @method Phaser.Tweens.Tween#resume
|
||||
* @since 3.0.0
|
||||
|
|
|
@ -8,18 +8,18 @@ var GetValue = require('./GetValue');
|
|||
var Clamp = require('../../math/Clamp');
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Retrieves and clamps a numerical value from an object.
|
||||
*
|
||||
* @function Phaser.Utils.Objects.GetMinMaxValue
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} source - [description]
|
||||
* @param {string} key - [description]
|
||||
* @param {number} min - [description]
|
||||
* @param {number} max - [description]
|
||||
* @param {number} defaultValue - [description]
|
||||
* @param {object} source - The object to retrieve the value from.
|
||||
* @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`).
|
||||
* @param {number} min - The minimum value which can be returned.
|
||||
* @param {number} max - The maximum value which can be returned.
|
||||
* @param {number} defaultValue - The value to return if the property doesn't exist. It's also constrained to the given bounds.
|
||||
*
|
||||
* @return {number} [description]
|
||||
* @return {number} The clamped value from the `source` object.
|
||||
*/
|
||||
var GetMinMaxValue = function (source, key, min, max, defaultValue)
|
||||
{
|
||||
|
|
|
@ -9,16 +9,16 @@
|
|||
// The default value to use if the key doesn't exist
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Retrieves a value from an object.
|
||||
*
|
||||
* @function Phaser.Utils.Objects.GetValue
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} source - [description]
|
||||
* @param {string} key - [description]
|
||||
* @param {*} defaultValue - [description]
|
||||
* @param {object} source - The object to retrieve the value from.
|
||||
* @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object.
|
||||
* @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.
|
||||
*
|
||||
* @return {*} [description]
|
||||
* @return {*} The value of the requested key.
|
||||
*/
|
||||
var GetValue = function (source, key, defaultValue)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue