Page 1 of 1
Keep Portrait Image and Name Text Visible
Posted: Sun Jul 03, 2022 3:33 pm
by Bolt Elite
Hey everyone, wanted to reach out and see if anyone has any ideas on how I can keep my NPCs name and background at the bottom right visible at all times. Not sure what I'm doing wrong and this seems to be something that's possible with this tool. Appreciate any help anyone can offer.
Re: Keep Portrait Image and Name Text Visible
Posted: Sun Jul 03, 2022 4:36 pm
by Tony Li
Hi,
The portrait name is part of the subtitle panel. If the subtitle panel's Visibility is set to Only During Content, as in your example, the portrait name will disappear when the subtitle panel disappears.
Here are two options:
1. Set the subtitle panel's Visibility to Always Once Shown or Until Superceded. This will keep the entire subtitle panel visible when the response menu appears.
2. Or separate the portrait name from the subtitle panel. In the example scene below, I removed the NPC subtitle panel's Portrait Name and added a Permanent Portrait Name to the Dialogue Panel. Then I added a short script to the dialogue UI that sets Permanent Portrait Name.
DS_KeepPortraitNameVisibleExample_2022-07-03.unitypackage
Here's the script:
Code: Select all
using UnityEngine;
using PixelCrushers;
using PixelCrushers.DialogueSystem;
// Alternatively, you could make a subclass of StandardDialogueUI.
public class SetPermanentPortraitName : MonoBehaviour
{
public UITextField permanentPortraitName;
public void OnConversationLine(Subtitle subtitle)
{
if (subtitle.speakerInfo.isNPC)
{
permanentPortraitName.text = subtitle.speakerInfo.Name;
}
}
}
Re: Keep Portrait Image and Name Text Visible
Posted: Sun Jul 03, 2022 4:55 pm
by Bolt Elite
This did the trick, thanks for the quick turn around Tony!
Re: Keep Portrait Image and Name Text Visible
Posted: Sun Jul 03, 2022 8:30 pm
by Tony Li
Glad to help!