RetroFont#setText()

setText(content, multiLine, characterSpacing, lineSpacing, lineAlignment, allowLowerCase)

A helper function that quickly sets lots of variables at once, and then updates the text.

Parameters
Name Type Argument Default Description
content string

The text of this sprite.

multiLine boolean <optional>
false

Set to true if you want to support carriage-returns in the text and create a multi-line sprite instead of a single line.

characterSpacing number <optional>
0

To add horizontal spacing between each character specify the amount in pixels.

lineSpacing number <optional>
0

To add vertical spacing between each line of text, set the amount in pixels.

lineAlignment string <optional>
'left'

Align each line of multi-line text. Set to RetroFont.ALIGN_LEFT, RetroFont.ALIGN_RIGHT or RetroFont.ALIGN_CENTER.

allowLowerCase boolean <optional>
false

Lots of bitmap font sets only include upper-case characters, if yours needs to support lower case then set this to true.

Source code: gameobjects/RetroFont.js (Line 293)
doc_phaser
2017-02-14 11:07:55
Comments
Leave a Comment

Please login to continue.