Show only Portrait image during response

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
cind7750
Posts: 4
Joined: Fri May 20, 2022 9:01 pm

Show only Portrait image during response

Post by cind7750 »

Hi Im new to Dialogue system and Unity
I have been learning to customize the dialogue system UI and was wondering if there is a way to hide subtitle elements except portrait image during response.
Currently I have all the subtitle elements hide during response.

Thanks
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show only Portrait image during response

Post by Tony Li »

Hi,

Thanks for using the Dialogue System!

The portrait image is part of the subtitle panel. If the subtitle panel's Visibility is set to Only During Content, all of the UI elements assigned to the subtitle panel (including the portrait image) will disappear when the subtitle panel disappears. If Visibility is set to some other value such as Until Superceded or Always Once Shown, all subtitle panel elements will stay visible during the response menu.

Here are two options to change that behavior:

1. Set the subtitle panel's Visibility to Always From Start, Always Once Shown, or Until Superceded. This will keep the entire subtitle panel visible when the response menu appears. But then configure the response menu's OnOpen() to hide the individual subtitle panel elements that want hidden during the response menu. The unitypackage below contains two examples scenes. The first scene hides individual subtitle panel elements. In this scene, I put the other subtitle elements in a child GameObject named Interior Panel. The response menu's OnOpen() method deactivates Interior Panel, and the subtitle panel's OnFocus() method reactivates it.

2. Or separate the portrait image from the subtitle panel. In the second example scene below, I removed the NPC subtitle panel's Portrait Image and added a Permanent Portrait Image to the Dialogue Panel. Then I added a short script to the dialogue UI that sets Permanent Portrait Image.

DS_KeepPortraitImageVisibleExamples_2022-07-03.unitypackage
cind7750
Posts: 4
Joined: Fri May 20, 2022 9:01 pm

Re: Show only Portrait image during response

Post by cind7750 »

Thank you for the detailed explanation and the package!
I checked all the scenes and was able to implement it on my game using the first method

Have a great day
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Show only Portrait image during response

Post by Tony Li »

Glad to help! :-)
Post Reply