mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 17:28:18 +00:00
Updated jsdocs and added align parameter to method call.
This commit is contained in:
parent
fa7259fd75
commit
90d08fbf24
3 changed files with 48 additions and 14 deletions
|
@ -55,7 +55,8 @@ var Phaser = Phaser || {
|
|||
VIDEO: 28,
|
||||
|
||||
/**
|
||||
* Various blend modes supported by pixi. IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.
|
||||
* Various blend modes supported by Pixi.
|
||||
* IMPORTANT: The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.
|
||||
*
|
||||
* @property {Object} blendModes
|
||||
* @property {Number} blendModes.NORMAL
|
||||
|
@ -98,7 +99,7 @@ var Phaser = Phaser || {
|
|||
},
|
||||
|
||||
/**
|
||||
* The scale modes that are supported by pixi.
|
||||
* The scale modes that are supported by Pixi.
|
||||
*
|
||||
* The DEFAULT scale mode affects the default scaling mode of future operations.
|
||||
* It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.
|
||||
|
|
|
@ -297,17 +297,34 @@ Phaser.GameObjectCreator.prototype = {
|
|||
/**
|
||||
* Create a new BitmapText object.
|
||||
*
|
||||
* BitmapText objects work by taking a texture file and an XML file that describes the font structure.
|
||||
* It then generates a new Sprite object for each letter of the text, proportionally spaced out and aligned to
|
||||
* match the font structure.
|
||||
*
|
||||
* BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability
|
||||
* to use Web Fonts. However you trade this flexibility for pure rendering speed. You can also create visually compelling BitmapTexts by
|
||||
* processing the font texture in an image editor first, applying fills and any other effects required.
|
||||
*
|
||||
* To create multi-line text insert \r, \n or \r\n escape codes into the text string.
|
||||
*
|
||||
* To create a BitmapText data files you can use:
|
||||
*
|
||||
* BMFont (Windows, free): http://www.angelcode.com/products/bmfont/
|
||||
* Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner
|
||||
* Littera (Web-based, free): http://kvazars.com/littera/
|
||||
*
|
||||
* @method Phaser.GameObjectCreator#bitmapText
|
||||
* @param {number} x - X position of the new bitmapText object.
|
||||
* @param {number} y - Y position of the new bitmapText object.
|
||||
* @param {string} font - The key of the BitmapText font as stored in Game.Cache.
|
||||
* @param {string} [text] - The actual text that will be rendered. Can be set later via BitmapText.text.
|
||||
* @param {number} [size] - The size the font will be rendered in, in pixels.
|
||||
* @param {number} x - X coordinate to display the BitmapText object at.
|
||||
* @param {number} y - Y coordinate to display the BitmapText object at.
|
||||
* @param {string} font - The key of the BitmapText as stored in Phaser.Cache.
|
||||
* @param {string} [text=''] - The text that will be rendered. This can also be set later via BitmapText.text.
|
||||
* @param {number} [size=32] - The size the font will be rendered at in pixels.
|
||||
* @param {string} [align='left'] - The alignment of multi-line text. Has no effect if there is only one line of text.
|
||||
* @return {Phaser.BitmapText} The newly created bitmapText object.
|
||||
*/
|
||||
bitmapText: function (x, y, font, text, size) {
|
||||
bitmapText: function (x, y, font, text, size, align) {
|
||||
|
||||
return new Phaser.BitmapText(this.game, x, y, font, text, size);
|
||||
return new Phaser.BitmapText(this.game, x, y, font, text, size, align);
|
||||
|
||||
},
|
||||
|
||||
|
|
|
@ -362,12 +362,28 @@ Phaser.GameObjectFactory.prototype = {
|
|||
/**
|
||||
* Create a new BitmapText object.
|
||||
*
|
||||
* BitmapText objects work by taking a texture file and an XML file that describes the font structure.
|
||||
* It then generates a new Sprite object for each letter of the text, proportionally spaced out and aligned to
|
||||
* match the font structure.
|
||||
*
|
||||
* BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability
|
||||
* to use Web Fonts. However you trade this flexibility for pure rendering speed. You can also create visually compelling BitmapTexts by
|
||||
* processing the font texture in an image editor first, applying fills and any other effects required.
|
||||
*
|
||||
* To create multi-line text insert \r, \n or \r\n escape codes into the text string.
|
||||
*
|
||||
* To create a BitmapText data files you can use:
|
||||
*
|
||||
* BMFont (Windows, free): http://www.angelcode.com/products/bmfont/
|
||||
* Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner
|
||||
* Littera (Web-based, free): http://kvazars.com/littera/
|
||||
*
|
||||
* @method Phaser.GameObjectFactory#bitmapText
|
||||
* @param {number} x - The x coordinate of the BitmapText. The coordinate is relative to any parent container this object may be in.
|
||||
* @param {number} y - The y coordinate of the BitmapText. The coordinate is relative to any parent container this object may be in.
|
||||
* @param {string} font - The key of the BitmapText font as stored in Game.Cache.
|
||||
* @param {string} [text] - The actual text that will be rendered. Can be set later via BitmapText.text.
|
||||
* @param {number} [size] - The size the font will be rendered in, in pixels.
|
||||
* @param {number} x - X coordinate to display the BitmapText object at.
|
||||
* @param {number} y - Y coordinate to display the BitmapText object at.
|
||||
* @param {string} font - The key of the BitmapText as stored in Phaser.Cache.
|
||||
* @param {string} [text=''] - The text that will be rendered. This can also be set later via BitmapText.text.
|
||||
* @param {number} [size=32] - The size the font will be rendered at in pixels.
|
||||
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
|
||||
* @return {Phaser.BitmapText} The newly created bitmapText object.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue