Good afternoon!
I have a question.
I created my dialogue template. There is one text panel for PC and NPS (character name and text.) but I need to constantly show the NPS image in the center of the screen first and until the end of the dialog. If I create a separate panel for the NPS then the image only appears when it has a replica in the dialog.
I hope that I have explained what I want to achieve in a way that is accessible.
Showing the NPS image throughout the dialog box
- Stalker_EG
- Posts: 31
- Joined: Sun Jul 07, 2019 7:57 pm
Re: Showing the NPS image throughout the dialog box
Hi,
Can you do the following?
If you need to hide the NPC Subtitle Panel when the PC is playing a subtitle, then you cannot use the steps above. Instead:
Can you do the following?
- Assign the center NPS image to the NPC Subtitle Panel's Portrait Image. Deactivate the other portrait image that is inside the subtitle panel.
- Set the NPC Subtitle Panel's Visibility to Always From Start.
If you need to hide the NPC Subtitle Panel when the PC is playing a subtitle, then you cannot use the steps above. Instead:
- Leave the NPC Subtitle Panel's Portrait Image unassigned.
- Add this script to your dialogue UI or Dialogue Manager, and assign the center NPC image to it:
Code: Select all
using UnityEngine;
using UnityEngine.UI;
using PixelCrushers.DialogueSystem;
public class SetNPSImage : MonoBehaviour
{
public Image NPSImage;
void OnConversationLine(Subtitle subtitle)
{
if (subtitle.speakerInfo.isNPC) NPSImage.sprite = subtitle.speakerInfo.portrait;
}
}
- Stalker_EG
- Posts: 31
- Joined: Sun Jul 07, 2019 7:57 pm
Re: Showing the NPS image throughout the dialog box
Thank you very much for the quick response. I'm gonna try to make these decisions today. I'll be sure to report the result.