Skip to content

Commit e297b32

Browse files
committed
Added hundreds of new jsdoc descriptions
1 parent ec6715b commit e297b32

39 files changed

Lines changed: 318 additions & 297 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ snowbillr
117117
Stephen Hamilton
118118
STuFF
119119
TadejZupancic
120+
telinc1
120121

121122
## Version 3.13.0 - Yuuki - 20th September 2018
122123

src/actions/PlaceOnLine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
var GetPoints = require('../geom/line/GetPoints');
88

99
/**
10-
* [description]
10+
* Positions an array of Game Objects on evenly spaced points of a Line.
1111
*
1212
* @function Phaser.Actions.PlaceOnLine
1313
* @since 3.0.0
1414
*
1515
* @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]
1616
*
1717
* @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.
18-
* @param {Phaser.Geom.Line} line - [description]
18+
* @param {Phaser.Geom.Line} line - The Line to position the Game Objects on.
1919
*
2020
* @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.
2121
*/

src/actions/SetHitArea.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
*/
66

77
/**
8-
* [description]
8+
* Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks.
9+
*
10+
* @see {@link Phaser.GameObjects.GameObject#setInteractive}
911
*
1012
* @function Phaser.Actions.SetHitArea
1113
* @since 3.0.0
1214
*
1315
* @generic {Phaser.GameObjects.GameObject[]} G - [items,$return]
1416
*
1517
* @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action.
16-
* @param {*} hitArea - [description]
17-
* @param {HitAreaCallback} hitAreaCallback - [description]
18+
* @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.
19+
* @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.
1820
*
1921
* @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.
2022
*/

src/create/GenerateTexture.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ var GetValue = require('../utils/object/GetValue');
2121
* @property {array} [data=[]] - [description]
2222
* @property {HTMLCanvasElement} [canvas=null] - [description]
2323
* @property {Palette} [palette=Arne16] - [description]
24-
* @property {number} [pixelWidth=1] - [description]
25-
* @property {number} [pixelHeight=1] - [description]
24+
* @property {number} [pixelWidth=1] - The width of each 'pixel' in the generated texture.
25+
* @property {number} [pixelHeight=1] - The height of each 'pixel' in the generated texture.
2626
* @property {boolean} [resizeCanvas=true] - [description]
2727
* @property {boolean} [clearCanvas=true] - [description]
2828
* @property {GenerateTextureRendererCallback} [preRender] - [description]

src/display/mask/GeometryMask.js

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ var Class = require('../../utils/Class');
88

99
/**
1010
* @classdesc
11-
* [description]
11+
* 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).
12+
*
13+
* 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.
14+
*
15+
* 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.
1216
*
1317
* @class GeometryMask
1418
* @memberOf Phaser.Display.Masks
1519
* @constructor
1620
* @since 3.0.0
1721
*
18-
* @param {Phaser.Scene} scene - [description]
19-
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description]
22+
* @param {Phaser.Scene} scene - This parameter is not used.
23+
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List.
2024
*/
2125
var GeometryMask = new Class({
2226

@@ -25,7 +29,7 @@ var GeometryMask = new Class({
2529
function GeometryMask (scene, graphicsGeometry)
2630
{
2731
/**
28-
* [description]
32+
* The Graphics object which describes the Geometry Mask.
2933
*
3034
* @name Phaser.Display.Masks.GeometryMask#geometryMask
3135
* @type {Phaser.GameObjects.Graphics}
@@ -35,27 +39,27 @@ var GeometryMask = new Class({
3539
},
3640

3741
/**
38-
* [description]
42+
* Sets a new Graphics object for the Geometry Mask.
3943
*
4044
* @method Phaser.Display.Masks.GeometryMask#setShape
4145
* @since 3.0.0
4246
*
43-
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - [description]
47+
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask.
4448
*/
4549
setShape: function (graphicsGeometry)
4650
{
4751
this.geometryMask = graphicsGeometry;
4852
},
4953

5054
/**
51-
* [description]
55+
* 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.
5256
*
5357
* @method Phaser.Display.Masks.GeometryMask#preRenderWebGL
5458
* @since 3.0.0
5559
*
56-
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description]
57-
* @param {Phaser.GameObjects.GameObject} mask - [description]
58-
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
60+
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to.
61+
* @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered.
62+
* @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.
5963
*/
6064
preRenderWebGL: function (renderer, mask, camera)
6165
{
@@ -83,31 +87,32 @@ var GeometryMask = new Class({
8387
},
8488

8589
/**
86-
* [description]
90+
* Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it.
8791
*
8892
* @method Phaser.Display.Masks.GeometryMask#postRenderWebGL
8993
* @since 3.0.0
9094
*
91-
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - [description]
95+
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush.
9296
*/
9397
postRenderWebGL: function (renderer)
9498
{
9599
var gl = renderer.gl;
96100

97101
// Force flush before disabling stencil test
98102
renderer.flush();
103+
99104
gl.disable(gl.STENCIL_TEST);
100105
},
101106

102107
/**
103-
* [description]
108+
* Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object.
104109
*
105110
* @method Phaser.Display.Masks.GeometryMask#preRenderCanvas
106111
* @since 3.0.0
107112
*
108-
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description]
109-
* @param {Phaser.GameObjects.GameObject} mask - [description]
110-
* @param {Phaser.Cameras.Scene2D.Camera} camera - [description]
113+
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on.
114+
* @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered.
115+
* @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.
111116
*/
112117
preRenderCanvas: function (renderer, mask, camera)
113118
{
@@ -121,12 +126,12 @@ var GeometryMask = new Class({
121126
},
122127

123128
/**
124-
* [description]
129+
* Restore the canvas context's previous clipping path, thus turning off the mask for it.
125130
*
126131
* @method Phaser.Display.Masks.GeometryMask#postRenderCanvas
127132
* @since 3.0.0
128133
*
129-
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - [description]
134+
* @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored.
130135
*/
131136
postRenderCanvas: function (renderer)
132137
{

src/geom/intersects/CircleToCircle.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
var DistanceBetween = require('../../math/distance/DistanceBetween');
88

99
/**
10-
* [description]
10+
* Checks if two Circles intersect.
1111
*
1212
* @function Phaser.Geom.Intersects.CircleToCircle
1313
* @since 3.0.0
1414
*
15-
* @param {Phaser.Geom.Circle} circleA - [description]
16-
* @param {Phaser.Geom.Circle} circleB - [description]
15+
* @param {Phaser.Geom.Circle} circleA - The first Circle to check for intersection.
16+
* @param {Phaser.Geom.Circle} circleB - The second Circle to check for intersection.
1717
*
18-
* @return {boolean} [description]
18+
* @return {boolean} `true` if the two Circles intersect, otherwise `false`.
1919
*/
2020
var CircleToCircle = function (circleA, circleB)
2121
{

src/geom/intersects/LineToLine.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ var Point = require('../point/Point');
1010
// See http:'local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
1111

1212
/**
13-
* [description]
13+
* Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting.
1414
*
1515
* @function Phaser.Geom.Intersects.LineToLine
1616
* @since 3.0.0
1717
*
18-
* @param {Phaser.Geom.Line} line1 - [description]
19-
* @param {Phaser.Geom.Line} line2 - [description]
20-
* @param {Phaser.Geom.Point} [out] - [description]
18+
* @param {Phaser.Geom.Line} line1 - The first Line to check.
19+
* @param {Phaser.Geom.Line} line2 - The second Line to check.
20+
* @param {Phaser.Geom.Point} [out] - A Point in which to optionally store the point of intersection.
2121
*
22-
* @return {boolean} [description]
22+
* @return {boolean} `true` if the two Lines intersect, and the `out` object will be populated, if given. Otherwise, `false`.
2323
*/
2424
var LineToLine = function (line1, line2, out)
2525
{

src/geom/intersects/TriangleToLine.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ var Contains = require('../triangle/Contains');
88
var LineToLine = require('./LineToLine');
99

1010
/**
11-
* [description]
11+
* Checks if a Triangle and a Line intersect.
12+
*
13+
* 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".
1214
*
1315
* @function Phaser.Geom.Intersects.TriangleToLine
1416
* @since 3.0.0
1517
*
16-
* @param {Phaser.Geom.Triangle} triangle - [description]
17-
* @param {Phaser.Geom.Line} line - [description]
18+
* @param {Phaser.Geom.Triangle} triangle - The Triangle to check with.
19+
* @param {Phaser.Geom.Line} line - The Line to check with.
1820
*
19-
* @return {boolean} [description]
21+
* @return {boolean} `true` if the Triangle and the Line intersect, otherwise `false`.
2022
*/
2123
var TriangleToLine = function (triangle, line)
2224
{

src/geom/point/Invert.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
*/
66

77
/**
8-
* [description]
8+
* Swaps the X and the Y coordinate of a point.
99
*
1010
* @function Phaser.Geom.Point.Invert
1111
* @since 3.0.0
1212
*
1313
* @generic {Phaser.Geom.Point} O - [point,$return]
1414
*
15-
* @param {Phaser.Geom.Point} point - [description]
15+
* @param {Phaser.Geom.Point} point - The Point to modify.
1616
*
17-
* @return {Phaser.Geom.Point} [description]
17+
* @return {Phaser.Geom.Point} The modified `point`.
1818
*/
1919
var Invert = function (point)
2020
{

src/geom/polygon/Contains.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
// Adapted from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html by Jonas Raoni Soares Silva
99

1010
/**
11-
* [description]
11+
* Checks if a point is within the bounds of a Polygon.
1212
*
1313
* @function Phaser.Geom.Polygon.Contains
1414
* @since 3.0.0
1515
*
16-
* @param {Phaser.Geom.Polygon} polygon - [description]
17-
* @param {number} x - [description]
18-
* @param {number} y - [description]
16+
* @param {Phaser.Geom.Polygon} polygon - The Polygon to check against.
17+
* @param {number} x - The X coordinate of the point to check.
18+
* @param {number} y - The Y coordinate of the point to check.
1919
*
20-
* @return {boolean} [description]
20+
* @return {boolean} `true` if the point is within the bounds of the Polygon, otherwise `false`.
2121
*/
2222
var Contains = function (polygon, x, y)
2323
{

0 commit comments

Comments
 (0)