# How to create dynamic texts in Phaser 3?

**URL:** <https://phaser.discourse.group/t/how-to-create-dynamic-texts-in-phaser-3/9570>\
**Category:** Phaser 3\
**Created:** [May 12, 2021, 6:44pm UTC](https://phaser.discourse.group/t/how-to-create-dynamic-texts-in-phaser-3/9570 "2021-05-12T18:44:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![YanKleber](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/yankleber/32/5152_2.png) [@YanKleber](https://phaser.discourse.group/u/YanKleber)\
**Post date:** [May 12, 2021, 6:45pm UTC](https://phaser.discourse.group/t/how-to-create-dynamic-texts-in-phaser-3/9570/1 "2021-05-12T18:45:00Z")

</div>

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](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/dynamictext/). But before to go and get it I’d like to be sure that Phaser 3 has not dynamic texts implemented natively.

🙃

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [May 12, 2021, 8:04pm UTC](https://phaser.discourse.group/t/how-to-create-dynamic-texts-in-phaser-3/9570/2 "2021-05-12T20:04:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![YanKleber](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/yankleber/32/5152_2.png) [@YanKleber](https://phaser.discourse.group/u/YanKleber)\
**Post date:** [May 12, 2021, 8:36pm UTC](https://phaser.discourse.group/t/how-to-create-dynamic-texts-in-phaser-3/9570/3 "2021-05-12T20:36:15Z")

</div>

Thanks a lot Samme!

I ended finding this great example:

> **[Phaser - Examples - Bitmaptext Canvas](https://phaser.io/examples/v3/view/game-objects/bitmaptext/static/bitmaptextcanvas)**
>
> Desktop and Mobile HTML5 game framework. A fast, free and fun open source framework for Canvas and WebGL powered browser games.

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?

---

<div class="post-metadata">

**Author:** ![rexrainbow](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/rexrainbow/32/51_2.png) [@rexrainbow](https://phaser.discourse.group/u/rexrainbow)\
**Post date:** [May 14, 2021, 12:02am UTC](https://phaser.discourse.group/t/how-to-create-dynamic-texts-in-phaser-3/9570/4 "2021-05-14T00:02:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![YanKleber](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/yankleber/32/5152_2.png) [@YanKleber](https://phaser.discourse.group/u/YanKleber)\
**Post date:** [May 14, 2021, 2:26pm UTC](https://phaser.discourse.group/t/how-to-create-dynamic-texts-in-phaser-3/9570/5 "2021-05-14T14:26:17Z")

</div>

Thanks Rex, I just realized this… 🤨
