Page 1 of 1

Hide part of dialogue panel in conversation

Posted: Thu Dec 23, 2021 10:16 pm
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?

Re: Hide part of dialogue panel in conversation

Posted: Thu Dec 23, 2021 10:24 pm
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).

Re: Hide part of dialogue panel in conversation

Posted: Thu Dec 23, 2021 11:54 pm
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.

Re: Hide part of dialogue panel in conversation

Posted: Fri Dec 24, 2021 4:54 pm
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.