Page 1 of 1

Can I change the color of the portrait name per actor?

Posted: Fri Jun 07, 2019 9:44 pm
by AoF
Just like the actor subtitles, I'd like to change the color of the portrait name depending on who's speaking. Is this possible?

Re: Can I change the color of the portrait name per actor?

Posted: Fri Jun 07, 2019 10:13 pm
by Tony Li
It would require a little scripting. Two suggestions:

Make a subclass of StandardUISubtitlePanel and override SetContent:

Code: Select all

public class MySubtitlePanel : StandardUISubtitlePanel
{
    public override void SetContent(Subtitle subtitle)
    {
        base.SetContent(subtitle);
        portraitName.color = //<-- ASSIGN YOUR COLOR HERE.
    }
}
Or add a script to the Dialogue Manager that has an OnConversationLine method:

Code: Select all

public Text portraitName; //<-- ASSIGN FROM DIALOGUE UI.

void OnConversationLine(Subtitle subtitle)
{
    portraitName.color = //<-- ASSIGN YOUR COLOR HERE.
}
You can store the color in a Text field on the actor in web format (#rrggbb) and then use Tools.WebColor() to get the Color value, like this:

Code: Select all

var actor = DialogueManager.GetActor(subtitle.speakerInfo.nameInDatabase);
portraitName.color = Tools.WebColor(actor.LookupValue("PortraitNameColor"));

Re: Can I change the color of the portrait name per actor?

Posted: Fri Jun 07, 2019 10:16 pm
by AoF
Cool, thanks a lot.