Text with one word in a different color?

Is it possible to use the Phaser 3 Text object to create a text where the sentense is one color, but one word is another color? So something like this:

phaser3_font_question

I’ve looked in the documentation and I couldn’t find any examples of this. If it’s not possible using the standard Text object, is there another way to accomplish this?

I know you could use 2 texts, one for the full sentence and one with a different color for the word, and then match the pixel position exactly so it overlaps the certain word. That would work for one particular sentence but I’m looking for more general approach for this, because there are several texts + different translations.

No, but I think a DOM game object would work.

1 Like