Display a text in two different colors with just one Label?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sensensensnes

Hello, I was wondering if there is a way to have a Label that shows specific parts (or words) of the given text String in different colors or size etc. using just one Label? I was going to be using this in a classic RPG textbox where keywords would be marked red in contrast to the default text (white).

similar to this one

:bust_in_silhouette: Reply From: jgodfrey

You can do that with a RichTextLabel control. To test:

  • Add one to a sample project
  • In the inspector, check the Enabled property under Bb Code
  • In the BB Code | Text property, add the following:

[color=blue]blue[/color] and [color=red]red[/color]

See the docs for details on Bbcode options: