Keep Portrait Image and Name Text Visible
-
- Posts: 2
- Joined: Sun Jul 03, 2022 3:21 pm
Keep Portrait Image and Name Text Visible
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.
- Attachments
-
- Screenshot 2022-07-03 122805.png (123.2 KiB) Viewed 241 times
-
- Screenshot 2022-07-03 122832.png (123.88 KiB) Viewed 241 times
Re: Keep Portrait Image and Name Text Visible
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:
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;
}
}
}
-
- Posts: 2
- Joined: Sun Jul 03, 2022 3:21 pm
Re: Keep Portrait Image and Name Text Visible
This did the trick, thanks for the quick turn around Tony!
Re: Keep Portrait Image and Name Text Visible
Glad to help!