Skip to content

Commit da05cfa

Browse files
authored
Merge pull request phaserjs#5244 from 16patsle/Fix_Text_types
Fix types for Text, TextFactory and TextCreator
2 parents c9330fd + edf0c17 commit da05cfa

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/gameobjects/text/static/Text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ var Text = new Class({
191191
* Allows you to add extra spacing if the browser is unable to accurately determine the true font dimensions.
192192
*
193193
* @name Phaser.GameObjects.Text#padding
194-
* @type {{left:number,right:number,top:number,bottom:number}}
194+
* @type {Phaser.Types.GameObjects.Text.TextPadding}
195195
* @since 3.0.0
196196
*/
197197
this.padding = { left: 0, right: 0, top: 0, bottom: 0 };

src/gameobjects/text/static/TextCreator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var Text = require('./Text');
1717
* @method Phaser.GameObjects.GameObjectCreator#text
1818
* @since 3.0.0
1919
*
20-
* @param {object} config - The configuration object this Game Object will use to create itself.
20+
* @param {Phaser.Types.GameObjects.Text.TextConfig} config - The configuration object this Game Object will use to create itself.
2121
* @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.
2222
*
2323
* @return {Phaser.GameObjects.Text} The Game Object that was created.

src/gameobjects/text/static/TextFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var GameObjectFactory = require('../../GameObjectFactory');
4141
* @param {number} x - The horizontal position of this Game Object in the world.
4242
* @param {number} y - The vertical position of this Game Object in the world.
4343
* @param {(string|string[])} text - The text this Text object will display.
44-
* @param {object} [style] - The Text style configuration object.
44+
* @param {Phaser.Types.GameObjects.Text.TextStyle} [style] - The Text style configuration object.
4545
*
4646
* @return {Phaser.GameObjects.Text} The Game Object that was created.
4747
*/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @typedef {object} Phaser.Types.GameObjects.Text.TextConfig
3+
* @extends Phaser.Types.GameObjects.GameObjectConfig
4+
* @since 3.0.0
5+
*
6+
* @property {(string|string[])} [text] - The text this Text object will display.
7+
* @property {Phaser.Types.GameObjects.Text.TextStyle} [style] - The Text style configuration object.
8+
* @property {Phaser.Types.GameObjects.Text.TextPadding} [padding] - A Text Padding object.
9+
*/

0 commit comments

Comments
 (0)