How to create dynamic texts in Phaser 3?

How dynamic texts are created? For dynamic texts I mean any text which contents can be change on the fly for score, lives, hints, etc. I couldn’t find any example of how doing it (only static that is useless for this purpose).

In fact the only reference to dynamic text I found was this plugin. But before to go and get it I’d like to be sure that Phaser 3 has not dynamic texts implemented natively.

:upside_down_face:

For BitmapText and Text you use the setText() method, or just modify the text property.

1 Like

Thanks a lot Samme!

I ended finding this great example:

I couldn’t find it before because my Google was funny (it was loading results and then 1-2 seconds later it was loading different results with links for shopping stores) and I realized that it was some extensions, probably having some backdoor exploited.

Anyway, I figured that the dynamic texts demands bitmap fonts. I thought that it could be done with TTF fonts?

Bitmap text uses image to show characters, not draw characters on canvas (official text object draw on canvas). Therefore Bitmap text can’t use font directly, unless user create image from that font.

1 Like

Thanks Rex, I just realized this… :face_with_raised_eyebrow: