Skip to content

Commit acc5f92

Browse files
authored
Merge pull request phaserjs#4503 from jcyuan/master
expose ParseXMLBitmapFont for combined XML font file
2 parents 9672602 + b6047df commit acc5f92

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/gameobjects/bitmaptext/static/BitmapText.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var Components = require('../../components');
99
var GameObject = require('../../GameObject');
1010
var GetBitmapTextSize = require('../GetBitmapTextSize');
1111
var ParseFromAtlas = require('../ParseFromAtlas');
12+
var ParseXMLBitmapFont = require('../ParseXMLBitmapFont');
1213
var Render = require('./BitmapTextRender');
1314

1415
/**
@@ -616,4 +617,20 @@ BitmapText.ALIGN_RIGHT = 2;
616617
*/
617618
BitmapText.ParseFromAtlas = ParseFromAtlas;
618619

620+
/**
621+
* Parse an XML font to Bitmap Font data for the Bitmap Font cache.
622+
*
623+
* @name Phaser.GameObjects.BitmapText.ParseXMLBitmapFont
624+
* @type {function}
625+
* @since 3.17.0
626+
*
627+
* @param {XMLDocument} xml - The XML Document to parse the font from.
628+
* @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter.
629+
* @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height.
630+
* @param {Phaser.Textures.Frame} [frame] - The texture frame to take into account while parsing.
631+
*
632+
* @return {Phaser.GameObjects.BitmapText.Types.BitmapFontData} The parsed Bitmap Font data.
633+
*/
634+
BitmapText.ParseXMLBitmapFont = ParseXMLBitmapFont;
635+
619636
module.exports = BitmapText;

0 commit comments

Comments
 (0)