Hi,
is there a way to also show an icon ?
To looks like this :
Also how could i make the continue button behave like this :
. text is typing > continue button > text is typed > continue button > next node
because it's behaving like this :
. text is typing > continue button > next node
Show portrait + icon during dialogues
Re: Show portrait + icon during dialogues
To show a big portrait and a small portrait (the one inside the text box), you can make a subclass of StandardUISubtitlePanel or StandardDialogueUI. For example, if you make a subclass of StandardDialogueUI, you could override the ShowSubtitle() method like this:
Code: Select all
public class MyDialogueUI : StandardDialogueUI
{
public Image smallPortraitImage; // Assign in inspector.
public override void ShowSubtitle(Subtitle subtitle)
{
base.ShowSubtitle(subtitle);
// For the small portrait, always use the actor's main portrait sprite:
var actor = DialogueManager.masterDatabase.GetActor(subtitle.speakerInfo.id);
smallPortraitImage.enabled = (actor != null);
if (actor != null) smallPortraitImage.sprite = actor.spritePortrait;
}
}
Add a StandardUIContinueButtonFastForward component to the continue button. Assign the Subtitle Text to it. Configure the Button's OnClick() to call StandardUIContinueButtonFastForward.OnFastForward.
To see an example, examine any of the dialogue UI prefabs that ship with the Dialogue System, such as the Basic Standard Dialogue UI.
Re: Show portrait + icon during dialogues
Thanks Tony,
Could you tell me where should i paste the code ?
Sry, i have 0 knowledge in coding.
Could you tell me where should i paste the code ?
Sry, i have 0 knowledge in coding.
Re: Show portrait + icon during dialogues
Hi,
Here's an example with the code:
DS_DualPortraitExample_2022-03-04.unitypackage
I started with the VN Template Standard Dialogue UI prefab. I replaced the StandardDialogueUI component with the DualPortraitDialogueUI script contains in the example above. Then I added a small portrait image and assigned it to the DualPortraitDialogueUI component.
Finally, in the conversation's first node, I used this sequence to tell the player and NPC (Oracle) to use portrait #2 for their large portrait images.
Here's an example with the code:
DS_DualPortraitExample_2022-03-04.unitypackage
I started with the VN Template Standard Dialogue UI prefab. I replaced the StandardDialogueUI component with the DualPortraitDialogueUI script contains in the example above. Then I added a small portrait image and assigned it to the DualPortraitDialogueUI component.
Finally, in the conversation's first node, I used this sequence to tell the player and NPC (Oracle) to use portrait #2 for their large portrait images.
Code: Select all
{{default}};
SetPortrait(Oracle, pic=2);
SetPortrait(Player, pic=2);
Re: Show portrait + icon during dialogues
Awesome !
Thanks Tony, the example really helped me.
Thanks Tony, the example really helped me.
Re: Show portrait + icon during dialogues
Glad to help!