Type Definitions
-
BitmapFontCharacterData
-
The font data for an individual character of a Bitmap Font.
Describes the character's position, size, offset and kerning.
As of version 3.50 it also includes the WebGL texture uv data.
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/BitmapFontCharacterData.js (Line 1)
Properties:
Name Type Description xnumber The x position of the character.
ynumber The y position of the character.
widthnumber The width of the character.
heightnumber The height of the character.
centerXnumber The center x position of the character.
centerYnumber The center y position of the character.
xOffsetnumber The x offset of the character.
yOffsetnumber The y offset of the character.
u0number WebGL texture u0.
v0number WebGL texture v0.
u1number WebGL texture u1.
v1number WebGL texture v1.
dataobject Extra data for the character.
kerningObject.<number> Kerning values, keyed by character code.
-
BitmapFontData
-
Bitmap Font data that can be used by a BitmapText Game Object.
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/BitmapFontData.js (Line 1)
Properties:
Name Type Description fontstring The name of the font.
sizenumber The size of the font.
lineHeightnumber The line height of the font.
retroFontboolean Whether this font is a retro font (monospace).
charsObject.<number, Phaser.Types.GameObjects.BitmapText.BitmapFontCharacterData> The character data of the font, keyed by character code. Each character datum includes a position, size, offset and more.
-
BitmapTextCharacter
-
A single entry from the
BitmapTextSizecharacters array.The position and dimensions take the font size into account, but are not translated into the local space of the Game Object itself.
Type:
- object
- Since: 3.50.0
- Source: src/gameobjects/bitmaptext/typedefs/BitmapTextCharacter.js (Line 1)
Properties:
Name Type Description inumber The index of this character within the BitmapText text string.
charstring The character.
codenumber The character code of the character.
xnumber The x position of the character in the BitmapText.
ynumber The y position of the character in the BitmapText.
wnumber The width of the character.
hnumber The height of the character.
tnumber The top of the line this character is on.
rnumber The right-most point of this character, including xAdvance.
bnumber The bottom of the line this character is on.
linenumber The line number the character appears on.
glyphPhaser.Types.GameObjects.BitmapText.BitmapFontCharacterData Reference to the glyph object this character is using.
-
BitmapTextConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/BitmapTextConfig.js (Line 1)
Properties:
Name Type Argument Default Description fontstring <optional>
'' The key of the font to use from the BitmapFont cache.
textstring <optional>
'' The string, or array of strings, to be set as the content of this Bitmap Text.
sizenumber | false <optional>
false The font size to set.
-
BitmapTextLines
-
Details about the line data in the
BitmapTextSizeobject.Type:
- object
- Since: 3.50.0
- Source: src/gameobjects/bitmaptext/typedefs/BitmapTextLines.js (Line 1)
Properties:
Name Type Description shortestnumber The width of the shortest line of text.
longestnumber The width of the longest line of text.
heightnumber The height of a line of text.
lengthsArray.<number> An array where each entry contains the length of that line of text.
-
BitmapTextSize
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/BitmapTextSize.js (Line 1)
Properties:
Name Type Description globalPhaser.Types.GameObjects.BitmapText.GlobalBitmapTextSize The position and size of the BitmapText, taking into account the position and scale of the Game Object.
localPhaser.Types.GameObjects.BitmapText.LocalBitmapTextSize The position and size of the BitmapText, taking just the font size into account.
linesPhaser.Types.GameObjects.BitmapText.BitmapTextLines Data about the lines of text within the BitmapText.
charactersArray.<Phaser.Types.GameObjects.BitmapText.BitmapTextCharacter> An array containing per-character data. Only populated if
includeCharsistruein thegetTextBoundscall.wordsArray.<Phaser.Types.GameObjects.BitmapText.BitmapTextWord> An array containing the word data from the BitmapText.
scalenumber The scale of the BitmapText font being rendered vs. font size in the text data.
scaleXnumber The scale X value of the BitmapText.
scaleYnumber The scale Y value of the BitmapText.
wrappedTextstring The wrapped text, if wrapping enabled and required.
-
BitmapTextWord
-
Details about a single world entry in the
BitmapTextSizeobject words array.Type:
- object
- Since: 3.50.0
- Source: src/gameobjects/bitmaptext/typedefs/BitmapTextWord.js (Line 1)
Properties:
Name Type Description xnumber The x position of the word in the BitmapText.
ynumber The y position of the word in the BitmapText.
wnumber The width of the word.
hnumber The height of the word.
inumber The index of the word within the line.
wordstring The word.
-
DisplayCallback(display)
-
Parameters:
Name Type Description displayPhaser.Types.GameObjects.BitmapText.DisplayCallbackConfig Settings of the character that is about to be rendered.
Returns:
Altered position, scale and rotation values for the character that is about to be rendered.
-
DisplayCallbackConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/DisplayCallbackConfig.js (Line 1)
Properties:
Name Type Description parentPhaser.GameObjects.DynamicBitmapText The Dynamic Bitmap Text object that owns this character being rendered.
tintPhaser.Types.GameObjects.BitmapText.TintConfig The tint of the character being rendered. Always zero in Canvas.
indexnumber The index of the character being rendered.
charCodenumber The character code of the character being rendered.
xnumber The x position of the character being rendered.
ynumber The y position of the character being rendered.
scalenumber The scale of the character being rendered.
rotationnumber The rotation of the character being rendered.
dataany Custom data stored with the character being rendered.
-
GlobalBitmapTextSize
-
The position and size of the Bitmap Text in global space, taking into account the Game Object's scale and world position.
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/GlobalBitmapTextSize.js (Line 1)
Properties:
Name Type Description xnumber The x position of the BitmapText, taking into account the x position and scale of the Game Object.
ynumber The y position of the BitmapText, taking into account the y position and scale of the Game Object.
widthnumber The width of the BitmapText, taking into account the x scale of the Game Object.
heightnumber The height of the BitmapText, taking into account the y scale of the Game Object.
-
JSONBitmapText
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/JSONBitmapText.js (Line 1)
Properties:
Name Type Description fontstring The name of the font.
textstring The text that this Bitmap Text displays.
fontSizenumber The size of the font.
letterSpacingnumber Adds / Removes spacing between characters.
alignnumber The alignment of the text in a multi-line BitmapText object.
-
LocalBitmapTextSize
-
The position and size of the Bitmap Text in local space, taking just the font size into account.
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/LocalBitmapTextSize.js (Line 1)
Properties:
Name Type Description xnumber The x position of the BitmapText.
ynumber The y position of the BitmapText.
widthnumber The width of the BitmapText.
heightnumber The height of the BitmapText.
-
RetroFontConfig
-
Type:
- object
- Since: 3.6.0
- Source: src/gameobjects/bitmaptext/typedefs/RetroFontConfig.js (Line 1)
Properties:
Name Type Description imagestring The key of the image containing the font.
offset.xnumber If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.
offset.ynumber If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.
widthnumber The width of each character in the font set.
heightnumber The height of each character in the font set.
charsstring The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.
charsPerRownumber The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth.
spacing.xnumber If the characters in the font set have horizontal spacing between them set the required amount here.
spacing.ynumber If the characters in the font set have vertical spacing between them set the required amount here.
lineSpacingnumber The amount of vertical space to add to the line height of the font.
-
TintConfig
-
Type:
- object
- Since: 3.0.0
- Source: src/gameobjects/bitmaptext/typedefs/TintConfig.js (Line 1)
Properties:
Name Type Description topLeftnumber The top left tint value. Always zero in canvas.
topRightnumber The top right tint value. Always zero in canvas.
bottomLeftnumber The bottom left tint value. Always zero in canvas.
bottomRightnumber The bottom right tint value. Always zero in canvas.
