Skip to content

Commit 90d08fb

Browse files
committed
Updated jsdocs and added align parameter to method call.
1 parent fa7259f commit 90d08fb

3 files changed

Lines changed: 48 additions & 14 deletions

File tree

src/Phaser.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ var Phaser = Phaser || {
5555
VIDEO: 28,
5656

5757
/**
58-
* Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.
58+
* Various blend modes supported by Pixi.
59+
* IMPORTANT: The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.
5960
*
6061
* @property {Object} blendModes
6162
* @property {Number} blendModes.NORMAL
@@ -98,7 +99,7 @@ var Phaser = Phaser || {
9899
},
99100

100101
/**
101-
* The scale modes that are supported by pixi.
102+
* The scale modes that are supported by Pixi.
102103
*
103104
* The DEFAULT scale mode affects the default scaling mode of future operations.
104105
* It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.

src/gameobjects/GameObjectCreator.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,34 @@ Phaser.GameObjectCreator.prototype = {
297297
/**
298298
* Create a new BitmapText object.
299299
*
300+
* BitmapText objects work by taking a texture file and an XML file that describes the font structure.
301+
* It then generates a new Sprite object for each letter of the text, proportionally spaced out and aligned to
302+
* match the font structure.
303+
*
304+
* BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability
305+
* to use Web Fonts. However you trade this flexibility for pure rendering speed. You can also create visually compelling BitmapTexts by
306+
* processing the font texture in an image editor first, applying fills and any other effects required.
307+
*
308+
* To create multi-line text insert \r, \n or \r\n escape codes into the text string.
309+
*
310+
* To create a BitmapText data files you can use:
311+
*
312+
* BMFont (Windows, free): http://www.angelcode.com/products/bmfont/
313+
* Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner
314+
* Littera (Web-based, free): http://kvazars.com/littera/
315+
*
300316
* @method Phaser.GameObjectCreator#bitmapText
301-
* @param {number} x - X position of the new bitmapText object.
302-
* @param {number} y - Y position of the new bitmapText object.
303-
* @param {string} font - The key of the BitmapText font as stored in Game.Cache.
304-
* @param {string} [text] - The actual text that will be rendered. Can be set later via BitmapText.text.
305-
* @param {number} [size] - The size the font will be rendered in, in pixels.
317+
* @param {number} x - X coordinate to display the BitmapText object at.
318+
* @param {number} y - Y coordinate to display the BitmapText object at.
319+
* @param {string} font - The key of the BitmapText as stored in Phaser.Cache.
320+
* @param {string} [text=''] - The text that will be rendered. This can also be set later via BitmapText.text.
321+
* @param {number} [size=32] - The size the font will be rendered at in pixels.
322+
* @param {string} [align='left'] - The alignment of multi-line text. Has no effect if there is only one line of text.
306323
* @return {Phaser.BitmapText} The newly created bitmapText object.
307324
*/
308-
bitmapText: function (x, y, font, text, size) {
325+
bitmapText: function (x, y, font, text, size, align) {
309326

310-
return new Phaser.BitmapText(this.game, x, y, font, text, size);
327+
return new Phaser.BitmapText(this.game, x, y, font, text, size, align);
311328

312329
},
313330

src/gameobjects/GameObjectFactory.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,28 @@ Phaser.GameObjectFactory.prototype = {
362362
/**
363363
* Create a new BitmapText object.
364364
*
365+
* BitmapText objects work by taking a texture file and an XML file that describes the font structure.
366+
* It then generates a new Sprite object for each letter of the text, proportionally spaced out and aligned to
367+
* match the font structure.
368+
*
369+
* BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability
370+
* to use Web Fonts. However you trade this flexibility for pure rendering speed. You can also create visually compelling BitmapTexts by
371+
* processing the font texture in an image editor first, applying fills and any other effects required.
372+
*
373+
* To create multi-line text insert \r, \n or \r\n escape codes into the text string.
374+
*
375+
* To create a BitmapText data files you can use:
376+
*
377+
* BMFont (Windows, free): http://www.angelcode.com/products/bmfont/
378+
* Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner
379+
* Littera (Web-based, free): http://kvazars.com/littera/
380+
*
365381
* @method Phaser.GameObjectFactory#bitmapText
366-
* @param {number} x - The x coordinate of the BitmapText. The coordinate is relative to any parent container this object may be in.
367-
* @param {number} y - The y coordinate of the BitmapText. The coordinate is relative to any parent container this object may be in.
368-
* @param {string} font - The key of the BitmapText font as stored in Game.Cache.
369-
* @param {string} [text] - The actual text that will be rendered. Can be set later via BitmapText.text.
370-
* @param {number} [size] - The size the font will be rendered in, in pixels.
382+
* @param {number} x - X coordinate to display the BitmapText object at.
383+
* @param {number} y - Y coordinate to display the BitmapText object at.
384+
* @param {string} font - The key of the BitmapText as stored in Phaser.Cache.
385+
* @param {string} [text=''] - The text that will be rendered. This can also be set later via BitmapText.text.
386+
* @param {number} [size=32] - The size the font will be rendered at in pixels.
371387
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
372388
* @return {Phaser.BitmapText} The newly created bitmapText object.
373389
*/

0 commit comments

Comments
 (0)