Phaser API Documentation

setFont(font, [size], [align])


Changes the font this BitmapText is using to render.

The new texture is loaded and applied to the BitmapText. The existing test, size and alignment are preserved, unless overridden via the arguments.


name type arguments description
font string

The key of the font to use from the Bitmap Font cache.

size number <optional>

The font size of this Bitmap Text. If not specified the current size will be used.

align number <optional>

The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used.


This BitmapText Object.