Skip to content

Commit 96fd0ad

Browse files
committed
JSDoc fixes.
1 parent 01a068f commit 96fd0ad

12 files changed

Lines changed: 31 additions & 71 deletions

File tree

src/gameobjects/BitmapData.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Phaser.BitmapData.prototype = {
238238
* If a string is given it will assume it's a cache key and look in Phaser.Cache for an image key matching the string.
239239
*
240240
* @method Phaser.BitmapData#load
241-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|HTMLCanvasElement|string} source - The object that will be used to populate this BitmapData. If you give a string it will try and find the Image in the Game.Cache first.
241+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|HTMLCanvasElement|string} source - The object that will be used to populate this BitmapData. If you give a string it will try and find the Image in the Game.Cache first.
242242
* @return {Phaser.BitmapData} This BitmapData object for method chaining.
243243
*/
244244
load: function (source) {
@@ -964,7 +964,7 @@ Phaser.BitmapData.prototype = {
964964
* You can use the more friendly methods like `copyRect` and `draw` to avoid having to remember them all.
965965
*
966966
* @method Phaser.BitmapData#copy
967-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|HTMLCanvasElement|string} [source] - The source to copy from. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself.
967+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|HTMLCanvasElement|string} [source] - The source to copy from. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself.
968968
* @param {number} [x=0] - The x coordinate representing the top-left of the region to copy from the source image.
969969
* @param {number} [y=0] - The y coordinate representing the top-left of the region to copy from the source image.
970970
* @param {number} [width] - The width of the region to copy from the source image. If not specified it will use the full source image width.
@@ -1151,7 +1151,7 @@ Phaser.BitmapData.prototype = {
11511151
* Copies the area defined by the Rectangle parameter from the source image to this BitmapData at the given location.
11521152
*
11531153
* @method Phaser.BitmapData#copyRect
1154-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|string} source - The Image to copy from. If you give a string it will try and find the Image in the Game.Cache.
1154+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|string} source - The Image to copy from. If you give a string it will try and find the Image in the Game.Cache.
11551155
* @param {Phaser.Rectangle} area - The Rectangle region to copy from the source image.
11561156
* @param {number} x - The destination x coordinate to copy the image to.
11571157
* @param {number} y - The destination y coordinate to copy the image to.
@@ -1220,8 +1220,8 @@ Phaser.BitmapData.prototype = {
12201220
* Draws the image onto this BitmapData using an image as an alpha mask.
12211221
*
12221222
* @method Phaser.BitmapData#alphaMask
1223-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|HTMLCanvasElement|string} source - The source to copy from. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself.
1224-
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|HTMLImage|HTMLCanvasElement|string} [mask] - The object to be used as the mask. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself. If you don't provide a mask it will use this BitmapData as the mask.
1223+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|HTMLCanvasElement|string} source - The source to copy from. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself.
1224+
* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapData|Image|HTMLCanvasElement|string} [mask] - The object to be used as the mask. If you give a string it will try and find the Image in the Game.Cache first. This is quite expensive so try to provide the image itself. If you don't provide a mask it will use this BitmapData as the mask.
12251225
* @param {Phaser.Rectangle} [sourceRect] - A Rectangle where x/y define the coordinates to draw the Source image to and width/height define the size.
12261226
* @param {Phaser.Rectangle} [maskRect] - A Rectangle where x/y define the coordinates to draw the Mask image to and width/height define the size.
12271227
* @return {Phaser.BitmapData} This BitmapData object for method chaining.
@@ -1359,7 +1359,7 @@ Phaser.BitmapData.prototype = {
13591359
*
13601360
* @method Phaser.BitmapData#textureLine
13611361
* @param {Phaser.Line} line - A Phaser.Line object that will be used to plot the start and end of the line.
1362-
* @param {string|HTMLImage} image - The key of an image in the Phaser.Cache to use as the texture for this line, or an actual Image.
1362+
* @param {string|Image} image - The key of an image in the Phaser.Cache to use as the texture for this line, or an actual Image.
13631363
* @param {string} [repeat='repeat-x'] - The pattern repeat mode to use when drawing the line. Either `repeat`, `repeat-x` or `no-repeat`.
13641364
* @return {Phaser.BitmapData} This BitmapData object for method chaining.
13651365
*/

src/gameobjects/Button.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,12 @@ Phaser.Button.prototype.setUpSound = function (sound, marker) {
461461
*/
462462
Phaser.Button.prototype.onInputOverHandler = function (sprite, pointer) {
463463

464+
// If the Pointer was only just released then we don't fire an over event
465+
if (pointer.justReleased())
466+
{
467+
return;
468+
}
469+
464470
if (this.freezeFrames === false)
465471
{
466472
this.setState(1);

src/gameobjects/Events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @class Phaser.Events
1919
* @constructor
20-
* @param {Phaser.Sprite} sprite - A reference to Description.
20+
* @param {Phaser.Sprite} sprite - A reference to the Sprite that owns this Events object.
2121
*/
2222
Phaser.Events = function (sprite) {
2323

src/gameobjects/RetroFont.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars,
108108
this.fixedWidth = 0;
109109

110110
/**
111-
* @property {HTMLImage} fontSet - A reference to the image stored in the Game.Cache that contains the font.
111+
* @property {Image} fontSet - A reference to the image stored in the Game.Cache that contains the font.
112112
*/
113113
this.fontSet = game.cache.getImage(key);
114114

src/input/InputHandler.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ Phaser.InputHandler.prototype = {
786786

787787
/**
788788
* Update.
789+
*
789790
* @method Phaser.InputHandler#update
790791
* @protected
791792
* @param {Phaser.Pointer} pointer
@@ -804,11 +805,11 @@ Phaser.InputHandler.prototype = {
804805
return false;
805806
}
806807

807-
if (this.draggable && this._draggedPointerID == pointer.id)
808+
if (this.draggable && this._draggedPointerID === pointer.id)
808809
{
809810
return this.updateDrag(pointer);
810811
}
811-
else if (this._pointerData[pointer.id].isOver === true)
812+
else if (this._pointerData[pointer.id].isOver)
812813
{
813814
if (this.checkPointerOver(pointer))
814815
{
@@ -826,6 +827,7 @@ Phaser.InputHandler.prototype = {
826827

827828
/**
828829
* Internal method handling the pointer over event.
830+
*
829831
* @method Phaser.InputHandler#_pointerOverHandler
830832
* @private
831833
* @param {Phaser.Pointer} pointer
@@ -862,6 +864,7 @@ Phaser.InputHandler.prototype = {
862864

863865
/**
864866
* Internal method handling the pointer out event.
867+
*
865868
* @method Phaser.InputHandler#_pointerOutHandler
866869
* @private
867870
* @param {Phaser.Pointer} pointer

src/input/Mouse.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,9 @@ Phaser.Mouse.prototype = {
479479

480480
/**
481481
* Internal pointerLockChange handler.
482+
*
482483
* @method Phaser.Mouse#pointerLockChange
483-
* @param {pointerlockchange} event - The native event from the browser. This gets stored in Mouse.event.
484+
* @param {Event} event - The native event from the browser. This gets stored in Mouse.event.
484485
*/
485486
pointerLockChange: function (event) {
486487

src/loader/Cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ Phaser.Cache.prototype = {
262262
*
263263
* @method Phaser.Cache#addRenderTexture
264264
* @param {string} key - The unique key by which you will reference this object.
265-
* @param {Phaser.Texture} texture - The texture to use as the base of the RenderTexture.
265+
* @param {Phaser.RenderTexture} texture - The texture to use as the base of the RenderTexture.
266266
*/
267267
addRenderTexture: function (key, texture) {
268268

src/math/Math.js

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -428,58 +428,6 @@ Phaser.Math = {
428428

429429
},
430430

431-
/**
432-
* Closest angle between two angles from a1 to a2 absolute value the return for exact angle
433-
* @method Phaser.Math#nearestAngleBetween
434-
* @param {number} a1
435-
* @param {number} a2
436-
* @param {boolean} radians - True if angle sizes are expressed in radians.
437-
* @return {number}
438-
nearestAngleBetween: function (a1, a2, radians) {
439-
440-
if (typeof radians === "undefined") { radians = true; }
441-
442-
var rd = (radians) ? Math.PI : 180;
443-
a1 = this.normalizeAngle(a1, radians);
444-
a2 = this.normalizeAngle(a2, radians);
445-
446-
if (a1 < -rd / 2 && a2 > rd / 2)
447-
{
448-
a1 += rd * 2;
449-
}
450-
451-
if (a2 < -rd / 2 && a1 > rd / 2)
452-
{
453-
a2 += rd * 2;
454-
}
455-
456-
return a2 - a1;
457-
458-
},
459-
*/
460-
461-
/**
462-
* Interpolate across the shortest arc between two angles.
463-
* @method Phaser.Math#interpolateAngles
464-
* @param {number} a1 - Description.
465-
* @param {number} a2 - Description.
466-
* @param {number} weight - Description.
467-
* @param {boolean} radians - True if angle sizes are expressed in radians.
468-
* @param {Description} ease - Description.
469-
* @return {number}
470-
interpolateAngles: function (a1, a2, weight, radians, ease) {
471-
472-
if (typeof radians === "undefined") { radians = true; }
473-
if (typeof ease === "undefined") { ease = null; }
474-
475-
a1 = this.normalizeAngle(a1, radians);
476-
a2 = this.normalizeAngleToAnother(a2, a1, radians);
477-
478-
return (typeof ease === 'function') ? ease(weight, a1, a2 - a1, 1) : this.interpolateFloat(a1, a2, weight);
479-
480-
},
481-
*/
482-
483431
/**
484432
* Generate a random bool result based on the chance value.
485433
* <p>
@@ -1014,7 +962,8 @@ Phaser.Math = {
1014962
},
1015963

1016964
/**
1017-
* Description.
965+
* Calculates a linear value over t.
966+
*
1018967
* @method Phaser.Math#Linear
1019968
* @param {number} p0
1020969
* @param {number} p1
@@ -1058,7 +1007,8 @@ Phaser.Math = {
10581007
},
10591008

10601009
/**
1061-
* Description.
1010+
* Calculates a callmum rom value.
1011+
*
10621012
* @method Phaser.Math#catmullRom
10631013
* @param {number} p0
10641014
* @param {number} p1

src/physics/p2/Body.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ Phaser.Physics.P2.Body = function (game, sprite, x, y, mass) {
6161
this.data.parent = this;
6262

6363
/**
64-
* @property {Phaser.InversePointProxy} velocity - The velocity of the body. Set velocity.x to a negative value to move to the left, position to the right. velocity.y negative values move up, positive move down.
64+
* @property {Phaser.Physics.P2.InversePointProxy} velocity - The velocity of the body. Set velocity.x to a negative value to move to the left, position to the right. velocity.y negative values move up, positive move down.
6565
*/
6666
this.velocity = new Phaser.Physics.P2.InversePointProxy(this.world, this.data.velocity);
6767

6868
/**
69-
* @property {Phaser.InversePointProxy} force - The force applied to the body.
69+
* @property {Phaser.Physics.P2.InversePointProxy} force - The force applied to the body.
7070
*/
7171
this.force = new Phaser.Physics.P2.InversePointProxy(this.world, this.data.force);
7272

src/sound/SoundManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Phaser.SoundManager = function (game) {
4141
this._muted = false;
4242

4343
/**
44-
* @property {Description} _unlockSource - Internal unlock tracking var.
44+
* @property {AudioContext} _unlockSource - Internal unlock tracking var.
4545
* @private
4646
* @default
4747
*/

0 commit comments

Comments
 (0)