Added setLetterSpacing method and exported value in toJSON (#3480)

This commit is contained in:
Richard Davey 2018-04-04 11:34:39 +01:00
parent 00929a0b05
commit 96507beda1

View file

@ -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;