Hide part of dialogue panel in conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Tony Chou
Posts: 7
Joined: Wed Jun 23, 2021 11:39 pm

Hide part of dialogue panel in conversation

Post by Tony Chou »

In my project, I tried to make dialogue system act like Japanese visual novel.
In my game I will show the player some exquisite background and tachie, so I would like the player can hide part of the dialogue box.
I wrote a script to complete this feature, but I encountered a small problem.
Image
Image
The NPC name not hide. I can't even close it manually in the inspector.
Image
How do I fix this bug?
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hide part of dialogue panel in conversation

Post by Tony Li »

Hi,

The images didn't come through in your post.

If you want to hide the dialogue UI, you can use the SetDialoguePanel(false) sequencer command or disable the canvas. To disable the canvas, give the Dialogue Manager's canvas a unique name such as "DialogueCanvas". Then use SendMessage(DialogueCanvas, false).
Tony Chou
Posts: 7
Joined: Wed Jun 23, 2021 11:39 pm

Re: Hide part of dialogue panel in conversation

Post by Tony Chou »

My purpose is not hide all canvas, but only subtitle and NPC name. Portrait image should still be visible even in hide state.
This is my code and conversation in visible state.
Image
Image

In invisible state NPC name is still visible.
Image

I would like hide NPC name and keep portrait image visible in invisible state.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Hide part of dialogue panel in conversation

Post by Tony Li »

Hi,

I'm not sure what's going on there. (Feel free to send a reproduction project to tony (at) pixelcrushers.com if you like.)

Another way to handle it would be to move the Portrait Name GameObject to be a child of the Text Panel's hierarchy. Add a Canvas Group the Text Panel. To hide everything except the portrait(s), set the Text Panel's Canvas Group Alpha to zero. This has two advantages:
  • You only need to change one property instead of managing the active/inactive states of 3 separate GameObjects.
  • You can animate the Alpha value from one to zero to fade out instead of disappearing immediately.
Post Reply