Skip to content

Commit c9bdb83

Browse files
committed
GameObject and Loader typedefs
1 parent f62ec4a commit c9bdb83

51 files changed

Lines changed: 245 additions & 193 deletions

Some content is hidden

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

src/gameobjects/pathfollower/PathFollower.js

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ var Sprite = require('../sprite/Sprite');
1212
var TWEEN_CONST = require('../../tweens/tween/const');
1313
var Vector2 = require('../../math/Vector2');
1414

15-
/**
16-
* Settings for a PathFollower.
17-
*
18-
* @typedef {object} PathConfig
19-
*
20-
* @property {number} duration - The duration of the path follow.
21-
* @property {number} from - The start position of the path follow, between 0 and 1.
22-
* @property {number} to - The end position of the path follow, between 0 and 1.
23-
* @property {boolean} [positionOnPath=false] - Whether to position the PathFollower on the Path using its path offset.
24-
* @property {boolean} [rotateToPath=false] - Should the PathFollower automatically rotate to point in the direction of the Path?
25-
* @property {number} [rotationOffset=0] - If the PathFollower is rotating to match the Path, this value is added to the rotation value. This allows you to rotate objects to a path but control the angle of the rotation as well.
26-
* @property {number} [startAt=0] - Current start position of the path follow, between 0 and 1.
27-
*/
28-
2915
/**
3016
* @classdesc
3117
* A PathFollower Game Object.
@@ -125,7 +111,7 @@ var PathFollower = new Class({
125111
* Settings for the PathFollower.
126112
*
127113
* @name Phaser.GameObjects.PathFollower#pathConfig
128-
* @type {?PathConfig}
114+
* @type {?Phaser.GameObjects.PathFollower.Types.PathConfig}
129115
* @default null
130116
* @since 3.0.0
131117
*/
@@ -145,13 +131,13 @@ var PathFollower = new Class({
145131
/**
146132
* Set the Path that this PathFollower should follow.
147133
*
148-
* Optionally accepts {@link PathConfig} settings.
134+
* Optionally accepts {@link Phaser.GameObjects.PathFollower.Types.PathConfig} settings.
149135
*
150136
* @method Phaser.GameObjects.PathFollower#setPath
151137
* @since 3.0.0
152138
*
153139
* @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time.
154-
* @param {PathConfig} [config] - Settings for the PathFollower.
140+
* @param {Phaser.GameObjects.PathFollower.Types.PathConfig} [config] - Settings for the PathFollower.
155141
*
156142
* @return {Phaser.GameObjects.PathFollower} This Game Object.
157143
*/
@@ -221,7 +207,7 @@ var PathFollower = new Class({
221207
* @method Phaser.GameObjects.PathFollower#startFollow
222208
* @since 3.3.0
223209
*
224-
* @param {(number|PathConfig)} [config={}] - The duration of the follow, or a PathFollower config object.
210+
* @param {(number|Phaser.GameObjects.PathFollower.Types.PathConfig)} [config={}] - The duration of the follow, or a PathFollower config object.
225211
* @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1.
226212
*
227213
* @return {Phaser.GameObjects.PathFollower} This Game Object.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Settings for a PathFollower.
3+
*
4+
* @typedef {object} Phaser.GameObjects.PathFollower.Types.PathConfig
5+
* @since 3.0.0
6+
*
7+
* @property {number} duration - The duration of the path follow.
8+
* @property {number} from - The start position of the path follow, between 0 and 1.
9+
* @property {number} to - The end position of the path follow, between 0 and 1.
10+
* @property {boolean} [positionOnPath=false] - Whether to position the PathFollower on the Path using its path offset.
11+
* @property {boolean} [rotateToPath=false] - Should the PathFollower automatically rotate to point in the direction of the Path?
12+
* @property {number} [rotationOffset=0] - If the PathFollower is rotating to match the Path, this value is added to the rotation value. This allows you to rotate objects to a path but control the angle of the rotation as well.
13+
* @property {number} [startAt=0] - Current start position of the path follow, between 0 and 1.
14+
*/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2019 Photon Storm Ltd.
4+
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5+
*/
6+
7+
/**
8+
* @namespace Phaser.GameObjects.PathFollower.Types
9+
*/

src/gameobjects/rendertexture/RenderTextureCreator.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ var GameObjectCreator = require('../GameObjectCreator');
99
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
1010
var RenderTexture = require('./RenderTexture');
1111

12-
/**
13-
* @typedef {object} RenderTextureConfig
14-
*
15-
* @property {number} [x=0] - The x coordinate of the RenderTexture's position.
16-
* @property {number} [y=0] - The y coordinate of the RenderTexture's position.
17-
* @property {number} [width=32] - The width of the RenderTexture.
18-
* @property {number} [height=32] - The height of the RenderTexture.
19-
*/
20-
2112
/**
2213
* Creates a new Render Texture Game Object and returns it.
2314
*
@@ -26,7 +17,7 @@ var RenderTexture = require('./RenderTexture');
2617
* @method Phaser.GameObjects.GameObjectCreator#renderTexture
2718
* @since 3.2.0
2819
*
29-
* @param {RenderTextureConfig} config - The configuration object this Game Object will use to create itself.
20+
* @param {Phaser.GameObjects.RenderTexture.Types.RenderTextureConfig} config - The configuration object this Game Object will use to create itself.
3021
* @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.
3122
*
3223
* @return {Phaser.GameObjects.RenderTexture} The Game Object that was created.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @typedef {object} Phaser.GameObjects.RenderTexture.Types.RenderTextureConfig
3+
* @since 3.2.0
4+
*
5+
* @property {number} [x=0] - The x coordinate of the RenderTextures position.
6+
* @property {number} [y=0] - The y coordinate of the RenderTextures position.
7+
* @property {number} [width=32] - The width of the RenderTexture.
8+
* @property {number} [height=32] - The height of the RenderTexture.
9+
*/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2019 Photon Storm Ltd.
4+
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5+
*/
6+
7+
/**
8+
* @namespace Phaser.GameObjects.RenderTexture.Types
9+
*/

src/gameobjects/sprite/SpriteCreator.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ var GameObjectCreator = require('../GameObjectCreator');
1010
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
1111
var Sprite = require('./Sprite');
1212

13-
/**
14-
* @typedef {object} SpriteConfig
15-
* @extends Phaser.GameObjects.Types.GameObjectConfig
16-
*
17-
* @property {string} [key] - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
18-
* @property {(number|string)} [frame] - An optional frame from the Texture this Game Object is rendering with.
19-
*/
20-
2113
/**
2214
* Creates a new Sprite Game Object and returns it.
2315
*
@@ -26,7 +18,7 @@ var Sprite = require('./Sprite');
2618
* @method Phaser.GameObjects.GameObjectCreator#sprite
2719
* @since 3.0.0
2820
*
29-
* @param {SpriteConfig} config - The configuration object this Game Object will use to create itself.
21+
* @param {Phaser.GameObjects.Sprite.Types.SpriteConfig} config - The configuration object this Game Object will use to create itself.
3022
* @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.
3123
*
3224
* @return {Phaser.GameObjects.Sprite} The Game Object that was created.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* @typedef {object} Phaser.GameObjects.Sprite.Types.SpriteConfig
3+
* @extends Phaser.GameObjects.Types.GameObjectConfig
4+
* @since 3.0.0
5+
*
6+
* @property {string} [key] - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
7+
* @property {(number|string)} [frame] - An optional frame from the Texture this Game Object is rendering with.
8+
*/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2019 Photon Storm Ltd.
4+
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5+
*/
6+
7+
/**
8+
* @namespace Phaser.GameObjects.Sprite.Types
9+
*/

src/gameobjects/text/GetTextSize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @since 3.0.0
1212
*
1313
* @param {Phaser.GameObjects.Text} text - The Text object to calculate the size from.
14-
* @param {BitmapTextMetrics} size - The Text metrics to use when calculating the size.
14+
* @param {Phaser.GameObjects.Text.Types.TextMetrics} size - The Text metrics to use when calculating the size.
1515
* @param {array} lines - The lines of text to calculate the size from.
1616
*
1717
* @return {object} An object containing dimensions of the Text object.

0 commit comments

Comments
 (0)