How to change subtitle color for specific characters?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
daylekeiron
Posts: 5
Joined: Sun Jan 18, 2015 12:42 am

How to change subtitle color for specific characters?

Post by daylekeiron »

Greetings,



I'm curious how to change the color of subtitles when a specific character is speaking, similiar to what walking dead and half life 2 does. I believe this is possible using the emphasis settings outlined in the dialogue manager, but I haven't been able to find any information on how to apply these to dialogue.



If anyone could help me out I'd greatly appreciate it.



Dayle.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

How to change subtitle color for specific characters?

Post by Tony Li »

Hi Dayle,



You can use emphasis tags or rich text codes on individual words and lines, but it may be too onerous to add them to every single line for a specific character. Instead, you can use this version of the Unity GUI dialogue UI that supports custom styles for each actor:



CustomActorGUIStyle_2015-01-23.unitypackage







If you do want to use emphasis tags or rich text, you can put them right in the Dialogue Text field of your dialogue entry.







Rich Text:

Dialogue Text: <b><color=cyan>Hello</color></b>, world!

Puts "Hello" in bold cyan.







Emphasis Tags:

Dialogue Text: [em1]Hello, world![/em1]

Puts the whole line in the style defined by emphasis tag 1. You can define emphasis tag styles on the Dialogue Editor's Database tab.
daylekeiron
Posts: 5
Joined: Sun Jan 18, 2015 12:42 am

How to change subtitle color for specific characters?

Post by daylekeiron »

Hi Tony,



Thanks for your reply. The rich text tags are working as described, however em tags cause the text to not appear. I am using a modified version of the SF dialogue UI for Unity's new UI system.



I thought maybe it was due to the modifications I had done, but loading all 3 of the new UI prefabs replicated the same result. Am I correct in assuming em tags cannot be used with the new UI, or is there a tickbox or something i need to check to make them work?



Thanks,



Dayle.
daylekeiron
Posts: 5
Joined: Sun Jan 18, 2015 12:42 am

How to change subtitle color for specific characters?

Post by daylekeiron »

Upon doing some extra experimentation, em tags are also not working on ANY of the pre-fab UIs, be it the old GUI or the new UI. Please advise?
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

How to change subtitle color for specific characters?

Post by Tony Li »

Hi Dayle,



It sounds like the emphasis style's color might be set to transparent. Open the Dialogue Editor on your dialogue database. On the Database tab, expand Emphasis Settings. Then look up the emphasis setting for the tag you're using (e.g., Emphasis 1 for [em1]) and click on the color to edit it. Make sure the "A" value is set to 255.
daylekeiron
Posts: 5
Joined: Sun Jan 18, 2015 12:42 am

How to change subtitle color for specific characters?

Post by daylekeiron »

Hey Tony,



Your hypothesis was correct, all the emphasis colors had alpha set to zero. Good job picking that out from such vague information. Thanks again.



Dayle.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

How to change subtitle color for specific characters?

Post by Tony Li »

Glad that was it! Please note that emphasis tags will apply to the entire line unless you tick Rich Text Emphases on the Dialogue Manager.
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: How to change subtitle color for specific characters?

Post by AoF »

When you google for "site:www.pixelcrushers.com character color" this is the first post that comes up, so I want to say that I think there's a new way to do this now: You can create a dialogue actor script on a game object and then check a box called "Set Subtitle Color." You no longer have to download a separate package. Just posting this to help others in the future.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to change subtitle color for specific characters?

Post by Tony Li »

Thanks!

There's also a separate, built-in Actor Subtitle Color component that sets the actor's color, but I think Dialogue Actor is the better way to go because it sets the actor's color and does much more.
Post Reply