Skip to content

Commit 0ef92e1

Browse files
committed
Merge branch 'pr/3439'
2 parents 63d2b49 + 90cf919 commit 0ef92e1

71 files changed

Lines changed: 712 additions & 267 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/actions/Call.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action.
2020
* @param {CallCallback} callback - The callback to be invoked. It will be passed just one argument: the item from the array.
21-
* @param {object} context - The scope in which the callback will be invoked.
21+
* @param {*} context - The scope in which the callback will be invoked.
2222
*
2323
* @return {array} The array of objects that was passed to this Action.
2424
*/

src/actions/GetFirst.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array.
1919
* @param {integer} [index=0] - An optional offset to start searching from within the items array.
2020
*
21-
* @return {object} The first object in the array that matches the comparison object, or `null` if no match was found.
21+
* @return {?(object|Phaser.GameObjects.GameObject)} The first object in the array that matches the comparison object, or `null` if no match was found.
2222
*/
2323
var GetFirst = function (items, compare, index)
2424
{

src/actions/GetLast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array.
1919
* @param {integer} [index=0] - An optional offset to start searching from within the items array.
2020
*
21-
* @return {object} The last object in the array that matches the comparison object, or `null` if no match was found.
21+
* @return {?(object|Phaser.GameObjects.GameObject)} The last object in the array that matches the comparison object, or `null` if no match was found.
2222
*/
2323
var GetLast = function (items, compare, index)
2424
{

src/cameras/2d/Camera.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ var Vector2 = require('../../math/Vector2');
2525
* @property {number} scrollX - The horizontal scroll of camera
2626
* @property {number} scrollY - The vertical scroll of camera
2727
* @property {string} backgroundColor - The background color of camera
28-
* @property {object} [bounds] - The bounds of camera // TODO 19/03/2018 Create BoundsObject ({x:number,y:number,width:number,height:number})
28+
* @property {object} [bounds] - The bounds of camera
29+
* @property {number} [bounds.x] - The horizontal position of bounds of camera
30+
* @property {number} [bounds.y] - The vertical position of bounds of camera
31+
* @property {number} [bounds.width] - The width of the bounds of camera
32+
* @property {number} [bounds.height] - The height of the bounds of camera
2933
*/
3034

3135
/**

src/cameras/sprite3d/Camera.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ var billboardMatrix = new Matrix4();
2424

2525
// @author attribute https://github.com/mattdesl/cam3d/wiki
2626

27+
/**
28+
* @typedef {object} RayDef
29+
*
30+
* @property {Phaser.Math.Vector3} origin - [description]
31+
* @property {Phaser.Math.Vector3} direction - [description]
32+
*/
33+
2734
/**
2835
* @classdesc
2936
* [description]
@@ -174,13 +181,6 @@ var Camera = new Class({
174181
*/
175182
this.far = 100;
176183

177-
/**
178-
* @typedef {object} RayDef
179-
*
180-
* @property {Phaser.Math.Vector3} origin - [description]
181-
* @property {Phaser.Math.Vector3} direction - [description]
182-
*/
183-
184184
/**
185185
* [description]
186186
*

src/gameobjects/BuildGameObject.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@ var BlendModes = require('../renderer/BlendModes');
88
var GetAdvancedValue = require('../utils/object/GetAdvancedValue');
99
var ScaleModes = require('../renderer/ScaleModes');
1010

11+
/**
12+
* @typedef {object} GameObjectConfig
13+
*
14+
* @property {number} [x=0] - [description]
15+
* @property {number} [y=0] - [description]
16+
* @property {number} [depth=0] - [description]
17+
* @property {boolean} [flipX=false] - [description]
18+
* @property {boolean} [flipY=false] - [description]
19+
* @property {?(number|object)} [scale=null] - [description]
20+
* @property {?(number|object)} [scrollFactor=null] - [description]
21+
* @property {number} [rotation=0] - [description]
22+
* @property {?number} [angle=null] - [description]
23+
* @property {number} [alpha=1] - [description]
24+
* @property {?(number|object)} [origin=null] - [description]
25+
* @property {number} [scaleMode=ScaleModes.DEFAULT] - [description]
26+
* @property {number} [blendMode=BlendModes.DEFAULT] - [description]
27+
* @property {boolean} [visible=true] - [description]
28+
* @property {boolean} [add=true] - [description]
29+
*/
30+
1131
/**
1232
* Builds a Game Object using the provided configuration object.
1333
*
@@ -16,7 +36,7 @@ var ScaleModes = require('../renderer/ScaleModes');
1636
*
1737
* @param {Phaser.Scene} scene - [description]
1838
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
19-
* @param {object} config - [description]
39+
* @param {GameObjectConfig} config - [description]
2040
*
2141
* @return {Phaser.GameObjects.GameObject} The built Game Object.
2242
*/

src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var DynamicBitmapText = new Class({
125125
* [description]
126126
*
127127
* @name Phaser.GameObjects.DynamicBitmapText#_bounds
128-
* @type {object}
128+
* @type {TextBounds}
129129
* @private
130130
* @since 3.0.0
131131
*/
@@ -360,7 +360,7 @@ var DynamicBitmapText = new Class({
360360
* @method Phaser.GameObjects.DynamicBitmapText#toJSON
361361
* @since 3.0.0
362362
*
363-
* @return {object} [description]
363+
* @return {JSONGameObject.<JSONBitmapText>} [description]
364364
*/
365365
toJSON: function ()
366366
{

src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,25 @@ var BuildGameObject = require('../../BuildGameObject');
99
var GameObjectCreator = require('../../GameObjectCreator');
1010
var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
1111

12+
/**
13+
* @typedef {object} BitmapTextConfig
14+
* @extends GameObjectConfig
15+
*
16+
* @property {string} [font=''] - [description]
17+
* @property {string} [text=''] - [description]
18+
* @property {(number|false)} [size=false] - [description]
19+
* @property {string} [align=''] - [description]
20+
*/
21+
1222
/**
1323
* Creates a new Dynamic Bitmap Text Game Object and returns it.
1424
*
1525
* Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser.
1626
*
1727
* @method Phaser.GameObjects.GameObjectCreator#dynamicBitmapText
1828
* @since 3.0.0
19-
*
20-
* @param {object} config - [description]
29+
*²
30+
* @param {BitmapTextConfig} config - [description]
2131
*
2232
* @return {Phaser.GameObjects.DynamicBitmapText} The Game Object that was created.
2333
*/

src/gameobjects/bitmaptext/static/BitmapText.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,24 @@ var Render = require('./BitmapTextRender');
1515
/**
1616
* @typedef {object} TextBounds
1717
*
18-
* @param {object} local - [description]
19-
* @param {number} local.x - [description]
20-
* @param {number} local.y - [description]
21-
* @param {number} local.width - [description]
22-
* @param {number} local.height - [description]
23-
* @param {object} global - [description]
24-
* @param {number} global.x - [description]
25-
* @param {number} global.y - [description]
26-
* @param {number} global.width - [description]
27-
* @param {number} global.height - [description]
18+
* @property {object} local - [description]
19+
* @property {number} local.x - [description]
20+
* @property {number} local.y - [description]
21+
* @property {number} local.width - [description]
22+
* @property {number} local.height - [description]
23+
* @property {object} global - [description]
24+
* @property {number} global.x - [description]
25+
* @property {number} global.y - [description]
26+
* @property {number} global.width - [description]
27+
* @property {number} global.height - [description]
28+
*/
29+
30+
/**
31+
* @typedef {object} JSONBitmapText
32+
*
33+
* @property {string} font - [description]
34+
* @property {string} text - [description]
35+
* @property {number} fontSize - [description]
2836
*/
2937

3038
/**
@@ -130,7 +138,7 @@ var BitmapText = new Class({
130138
* [description]
131139
*
132140
* @name Phaser.GameObjects.BitmapText#_bounds
133-
* @type {object}
141+
* @type {TextBounds}
134142
* @private
135143
* @since 3.0.0
136144
*/
@@ -248,7 +256,7 @@ var BitmapText = new Class({
248256
* @method Phaser.GameObjects.BitmapText#toJSON
249257
* @since 3.0.0
250258
*
251-
* @return {JSONGameObject} [description]
259+
* @return {JSONGameObject.<JSONBitmapText>} [description]
252260
*/
253261
toJSON: function ()
254262
{

src/gameobjects/bitmaptext/static/BitmapTextCreator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var GetValue = require('../../../utils/object/GetValue');
1818
* @method Phaser.GameObjects.GameObjectCreator#bitmapText
1919
* @since 3.0.0
2020
*
21-
* @param {object} config - [description]
21+
* @param {BitmapTextConfig} config - [description]
2222
*
2323
* @return {Phaser.GameObjects.BitmapText} The Game Object that was created.
2424
*/

0 commit comments

Comments
 (0)