Can I change the color of the portrait name per actor?
Can I change the color of the portrait name per actor?
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?
It would require a little scripting. Two suggestions:
Make a subclass of StandardUISubtitlePanel and override SetContent:
Or add a script to the Dialogue Manager that has an OnConversationLine method:
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:
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.
}
}
Code: Select all
public Text portraitName; //<-- ASSIGN FROM DIALOGUE UI.
void OnConversationLine(Subtitle subtitle)
{
portraitName.color = //<-- ASSIGN YOUR COLOR HERE.
}
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?
Cool, thanks a lot.