Namespace: RetroFont

Phaser.GameObjects. RetroFont

Members


<static> TEXT_SET1 :string

Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 9)

<static> TEXT_SET2 :string

Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 18)

<static> TEXT_SET3 :string

Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 27)

<static> TEXT_SET4 :string

Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 36)

<static> TEXT_SET5 :string

Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 45)

<static> TEXT_SET6 :string

Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.'

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 54)

<static> TEXT_SET7 :string

Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 63)

<static> TEXT_SET8 :string

Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 72)

<static> TEXT_SET9 :string

Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?!

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 81)

<static> TEXT_SET10 :string

Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 90)

<static> TEXT_SET11 :string

Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789

Type:
  • string
Since: 3.6.0
Source: src/gameobjects/bitmaptext/const.js (Line 99)

Methods


<static> Parse(scene, config)

Parses a Retro Font configuration object so you can pass it to the BitmapText constructor
and create a BitmapText object using a fixed-width retro font.

Parameters:
Name Type Description
scene Phaser.Scene

A reference to the Phaser Scene.

config Phaser.GameObjects.RetroFont.Config

The font configuration object.

Since: 3.0.0
Source: src/gameobjects/bitmaptext/ParseRetroFont.js (Line 9)
Returns:

A parsed Bitmap Font data entry for the Bitmap Font cache.

Type
object

Type Definitions


Config

Type:
  • object
Properties:
Name Type Description
image string

The key of the image containing the font.

offset.x number

If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.

offset.y number

If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.

width number

The width of each character in the font set.

height number

The height of each character in the font set.

chars string

The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.

charsPerRow number

The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth.

spacing.x number

If the characters in the font set have horizontal spacing between them set the required amount here.

spacing.y number

If the characters in the font set have vertical spacing between them set the required amount here.

lineSpacing number

The amount of vertical space to add to the line height of the font.

Source: src/gameobjects/bitmaptext/RetroFont.js (Line 10)