Skip to content

Commit 7eda747

Browse files
authored
Merge pull request phaserjs#3891 from FelixNemis/retrofont-line-spacing
Add lineSpacing option to RetroFont Config
2 parents 41c9f8b + 6a1c677 commit 7eda747

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/gameobjects/bitmaptext/ParseRetroFont.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var ParseRetroFont = function (scene, config)
3636
var offsetY = GetValue(config, 'offset.y', 0);
3737
var spacingX = GetValue(config, 'spacing.x', 0);
3838
var spacingY = GetValue(config, 'spacing.y', 0);
39+
var lineSpacing = GetValue(config, 'lineSpacing', 0);
3940

4041
var charsPerRow = GetValue(config, 'charsPerRow', null);
4142

@@ -56,7 +57,7 @@ var ParseRetroFont = function (scene, config)
5657
retroFont: true,
5758
font: key,
5859
size: w,
59-
lineHeight: h,
60+
lineHeight: h + lineSpacing,
6061
chars: {}
6162
};
6263

src/gameobjects/bitmaptext/RetroFont.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var Extend = require('../../utils/object/Extend');
1919
* @property {number} charsPerRow - The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth.
2020
* @property {number} spacing.x - If the characters in the font set have horizontal spacing between them set the required amount here.
2121
* @property {number} spacing.y - If the characters in the font set have vertical spacing between them set the required amount here.
22+
* @property {number} lineSpacing - The amount of vertical space to add to the line height of the font.
2223
*/
2324

2425
/**

0 commit comments

Comments
 (0)