mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Added setLetterSpacing
method and exported value in toJSON
(#3480)
This commit is contained in:
parent
00929a0b05
commit
96507beda1
1 changed files with 23 additions and 1 deletions
|
@ -173,6 +173,27 @@ var BitmapText = new Class({
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the letter spacing between each character of this Bitmap Text.
|
||||||
|
* Can be a positive value to increase the space, or negative to reduce it.
|
||||||
|
* Spacing is applied after the kerning values have been set.
|
||||||
|
*
|
||||||
|
* @method Phaser.GameObjects.BitmapText#setLetterSpacing
|
||||||
|
* @since 3.4.0
|
||||||
|
*
|
||||||
|
* @param {number} [spacing=0] - The amount of horizontal space to add between each character.
|
||||||
|
*
|
||||||
|
* @return {Phaser.GameObjects.BitmapText} This Game Object.
|
||||||
|
*/
|
||||||
|
setLetterSpacing: function (spacing)
|
||||||
|
{
|
||||||
|
if (spacing === undefined) { spacing = 0; }
|
||||||
|
|
||||||
|
this.letterSpacing = spacing;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [description]
|
* [description]
|
||||||
*
|
*
|
||||||
|
@ -278,7 +299,8 @@ var BitmapText = new Class({
|
||||||
var data = {
|
var data = {
|
||||||
font: this.font,
|
font: this.font,
|
||||||
text: this.text,
|
text: this.text,
|
||||||
fontSize: this.fontSize
|
fontSize: this.fontSize,
|
||||||
|
letterSpacing: this.letterSpacing
|
||||||
};
|
};
|
||||||
|
|
||||||
out.data = data;
|
out.data = data;
|
||||||
|
|
Loading…
Reference in a new issue