Skip to content

Commit 4e208c7

Browse files
committed
Merge pull request phaserjs#2128 from nlotz/nlotz-loader-cache-addbitmapfont-apply-default-spacing
Fixes for Cache::addBitmapFont(...)
2 parents c79a341 + 6d4dad7 commit 4e208c7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/loader/Cache.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ Phaser.Cache.prototype = {
439439
* @param {string} url - The URL the asset was loaded from. If the asset was not loaded externally set to `null`.
440440
* @param {object} data - Extra font data.
441441
* @param {object} atlasData - Texture atlas frames data.
442+
* @param {string} [atlasType='xml'] - The format of the texture atlas ( 'json' or 'xml' ).
442443
* @param {number} [xSpacing=0] - If you'd like to add additional horizontal spacing between the characters then set the pixel value here.
443444
* @param {number} [ySpacing=0] - If you'd like to add additional vertical spacing between the lines then set the pixel value here.
444445
*/
@@ -450,7 +451,10 @@ Phaser.Cache.prototype = {
450451
font: null,
451452
base: new PIXI.BaseTexture(data)
452453
};
453-
454+
455+
if (xSpacing === undefined) { xSpacing = 0; }
456+
if (ySpacing === undefined) { ySpacing = 0; }
457+
454458
if (atlasType === 'json')
455459
{
456460
obj.font = Phaser.LoaderParser.jsonBitmapFont(atlasData, obj.base, xSpacing, ySpacing);

0 commit comments

Comments
 (0)