I'm having a problem getting the Subtitle Color I apply in my NPC's Dialogue Actor component to display when using the SMS prefab.
My goal is to have a feeling of a group text thread where each participant is identified by a different font color. I added placeholder portrait sprites to test whether changes to the Dialogue Actor component were working in principle, but in the long run I'd like to identify NPCs by color alone.
I think I have everything hooked up ok, or at least it works with these settings when using the WRPG template.
I tried fixing it by turning the alpha right down on the Text Color in the NPC Subtitle Text component, but this just made it disappear entirely. I even tried adding an Override Dialogue UI component to the NPC, but couldn't make that work either.
I then tried assigning a different NPC panel to an additional color, and while this kind of worked when editing, it still didn't display at runtime. (Anyway since the Dialogue Actor Subtitle Color is there it would be nice to use it, since it seems a more elegant and scaleable solution.)
Am I missing something obvious? Or is the SMS prefab only configured to work with one text color?
Thanks in advance!
Dialogue Actor Subtitle Color not working with SMS prefab
Re: Dialogue Actor Subtitle Color not working with SMS prefab
Hi,
In those SMS-style screenshots, it looks like the text is always white and the bubble colors vary by actor.
Is that the way you want it to work? If so, here's an example exported from Unity 2021:
DS_CustomSMSExample_2022-05-11.unitypackage
It looks like this:
It uses the subclass of SMSDialogueUI below that supports additional subtitle panel templates. (See: Instructions on replacing scripts in-place.)
To add more subtitle panels, duplicate NPC Message Template, customize the Bubble color, and assign the duplicate to the Standard Dialogue UI component's Conversation UI Elements > Subtitle Panels list. Make a note of the panel's number (0, 1, 2, etc.). Then add a Dialogue Actor component to an NPC, and set its Dialogue UI Settings > Subtitle Panel Number to match.
CustomSMSDialogueUI.cs
In those SMS-style screenshots, it looks like the text is always white and the bubble colors vary by actor.
Is that the way you want it to work? If so, here's an example exported from Unity 2021:
DS_CustomSMSExample_2022-05-11.unitypackage
It looks like this:
It uses the subclass of SMSDialogueUI below that supports additional subtitle panel templates. (See: Instructions on replacing scripts in-place.)
To add more subtitle panels, duplicate NPC Message Template, customize the Bubble color, and assign the duplicate to the Standard Dialogue UI component's Conversation UI Elements > Subtitle Panels list. Make a note of the panel's number (0, 1, 2, etc.). Then add a Dialogue Actor component to an NPC, and set its Dialogue UI Settings > Subtitle Panel Number to match.
CustomSMSDialogueUI.cs
Code: Select all
using PixelCrushers.DialogueSystem;
public class CustomSMSDialogueUI : SMSDialogueUI
{
protected override StandardUISubtitlePanel GetTemplate(Subtitle subtitle)
{
var panelNumber = DialogueActor.GetSubtitlePanelNumber(subtitle.speakerInfo.transform);
return (panelNumber == SubtitlePanelNumber.Default)
? base.GetTemplate(subtitle)
: conversationUIElements.subtitlePanels[PanelNumberUtility.GetSubtitlePanelIndex(panelNumber)];
}
}
Re: Dialogue Actor Subtitle Color not working with SMS prefab
No, the opposite is the problem. I'm trying to make the text colour itself vary for each NPC and haven't been able to do so at runtime, hence the screenshots showing white text.
However I think after banging my head against this mystery for a few hours I am prepared to give the differently coloured bubbles a try if that is easier to implement. It may even work better for readability in the long run.
I probably won't be at my unity workstation for the rest of the day but will try the solution you've proposed tomorrow. Thanks Tony!
Re: Dialogue Actor Subtitle Color not working with SMS prefab
Got it. This updated SMSDialogueUI will let you override the text color using Dialogue Actors. The change will also be in version 2.2.28.
DS_SMSDialogueUIPatch_2022-05-11.unitypackage
It also supports multiple template subtitle panels, so if you decide to go with different bubbles you don't need to use the CustomSMSDialogueUI script above.
DS_SMSDialogueUIPatch_2022-05-11.unitypackage
It also supports multiple template subtitle panels, so if you decide to go with different bubbles you don't need to use the CustomSMSDialogueUI script above.
Re: Dialogue Actor Subtitle Color not working with SMS prefab
Yep, that works straight out of the box. Thanks!