Skip to content

Commit 79c3242

Browse files
committed
Tweaked and filled in a few more BitmapText related descriptions.
1 parent c9d4ff9 commit 79c3242

5 files changed

Lines changed: 22 additions & 11 deletions

File tree

src/gameobjects/bitmaptext/ParseFromAtlas.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ var ParseXMLBitmapFont = require('./ParseXMLBitmapFont');
99
/**
1010
* Parse an XML Bitmap Font from an Atlas.
1111
*
12+
* Adds the parsed Bitmap Font data to the cache with the `fontName` key.
13+
*
1214
* @function ParseFromAtlas
1315
* @since 3.0.0
1416
* @private
@@ -20,6 +22,8 @@ var ParseXMLBitmapFont = require('./ParseXMLBitmapFont');
2022
* @param {string} xmlKey - The key of the XML data of the font to parse.
2123
* @param {integer} xSpacing - The x-axis spacing to add between each letter.
2224
* @param {integer} ySpacing - The y-axis spacing to add to the line height.
25+
*
26+
* @return {boolean} Whether the parsing was successful or not.
2327
*/
2428
var ParseFromAtlas = function (scene, fontName, textureKey, frameKey, xmlKey, xSpacing, ySpacing)
2529
{

src/gameobjects/bitmaptext/ParseXMLBitmapFont.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@
55
*/
66

77
/**
8+
* Read an integer value from an XML Node.
9+
*
810
* @function getValue
911
* @since 3.0.0
1012
* @private
13+
*
14+
* @param {Node} node - The XML Node.
15+
* @param {string} attribute - The attribute to read.
16+
*
17+
* @return {integer} The parsed value.
1118
*/
1219
function getValue (node, attribute)
1320
{
1421
return parseInt(node.getAttribute(attribute), 10);
1522
}
1623

1724
/**
18-
* Parse an XML font so you can pass it to the BitmapText constructor and create a BitmapText object.
25+
* Parse an XML font to Bitmap Font data for the Bitmap Font cache.
1926
*
2027
* @function ParseXMLBitmapFont
2128
* @since 3.0.0

src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ var Render = require('./DynamicBitmapTextRender');
5353
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. It can only belong to one Scene at any given time.
5454
* @param {number} x - The x coordinate of this Game Object in world space.
5555
* @param {number} y - The y coordinate of this Game Object in world space.
56-
* @param {string} font - [description]
57-
* @param {(string|string[])} [text] - [description]
58-
* @param {number} [size] - [description]
56+
* @param {string} font - The key of the font to use from the Bitmap Font cache.
57+
* @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text.
58+
* @param {number} [size] - The font size of this Bitmap Text.
5959
*/
6060
var DynamicBitmapText = new Class({
6161

@@ -114,7 +114,7 @@ var DynamicBitmapText = new Class({
114114
this.text = '';
115115

116116
/**
117-
* The size of this Bitmap Text.
117+
* The font size of this Bitmap Text.
118118
*
119119
* @name Phaser.GameObjects.DynamicBitmapText#fontSize
120120
* @type {number}

src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
1313
* @typedef {object} BitmapTextConfig
1414
* @extends GameObjectConfig
1515
*
16-
* @property {string} [font=''] - [description]
17-
* @property {string} [text=''] - [description]
18-
* @property {(number|false)} [size=false] - [description]
19-
* @property {string} [align='left'] - [description]
16+
* @property {string} [font=''] - The key of the font to use from the BitmapFont cache.
17+
* @property {string} [text=''] - The string, or array of strings, to be set as the content of this Bitmap Text.
18+
* @property {(number|false)} [size=false] - The font size to set.
19+
* @property {string} [align='left'] - The alignment to set.
2020
*/
2121

2222
/**

src/gameobjects/bitmaptext/static/BitmapText.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var Render = require('./BitmapTextRender');
8080
* @param {number} y - The y coordinate of this Game Object in world space.
8181
* @param {string} font - The key of the font to use from the Bitmap Font cache.
8282
* @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text.
83-
* @param {number} [size] - The size of this Bitmap Text.
83+
* @param {number} [size] - The font size of this Bitmap Text.
8484
*/
8585
var BitmapText = new Class({
8686

@@ -140,7 +140,7 @@ var BitmapText = new Class({
140140
this.text = '';
141141

142142
/**
143-
* The size of this Bitmap Text.
143+
* The font size of this Bitmap Text.
144144
*
145145
* @name Phaser.GameObjects.BitmapText#fontSize
146146
* @type {number}

0 commit comments

Comments
 (0)