Page 1 of 1
How to have the character name a different color
Posted: Tue Aug 29, 2023 6:27 pm
by Embro674
I have scrolling text that is appended that look like the below:
"Person 1: Hello!"
"Person 2: What's up?"
What I am looking for is a way to to have the "Person 1:" and "Person 2:" Parts a different color/boldened. This would help the different conversation entries seem more distinct. Thank you!
Re: How to have the character name a different color
Posted: Tue Aug 29, 2023 8:10 pm
by Tony Li
Hi,
If you want to use the same color for all actors' names, inspect the subtitle panel in your dialogue UI. Tick Add Speaker Name. Set the Add Speaker Name Format to something like:
The {0} will be replaced by the actor's name. The {1} will be replaced by the dialogue text. The [em1]...[/em1] are emphasis tags, whose appearance you can set in the Dialogue Editor's Database section.
If you prefer to use rich text codes, you can use those instead, like:
Code: Select all
<color=red><b>{0}</b></color>: {1}
If you want to use a different color/style for each actor, leave Add Speaker Name UNticked. Instead, add a Dialogue Actor component to the actor's GameObject. If the actor doesn't have a GameObject, you can create an empty one. Set the Actor field. Then tick Set Subtitle Color and Apply Color To Prepended Name.
Re: How to have the character name a different color
Posted: Wed Aug 30, 2023 5:50 am
by Embro674
The "[em1]{0}[/em1]: {1}" Didn't work, it just made the name display as; "[em1]Name[/em1]: Hello World!".
However, adding the "Dialogue Actor component" worked exactly how I wanted. Thank you very much!
Re: How to have the character name a different color
Posted: Wed Aug 30, 2023 11:17 am
by Tony Li
Hmm, I'll check that the first option properly parses the [em#] tags. Anyway, I'm glad the Dialogue Actor approach met your needs!