Page 1 of 1

NPC subtitle and response menus intersecting

Posted: Wed Jun 07, 2023 12:32 am
by ujuj04
Hey, I'm trying to make the dialogue UI for my game and this is the style I decided to go for. Death (Portrait name), Wake up...(NPC subtitle), WHAT no way (response). When my NPC subtitle gets too long, it goes down and intersects with the response section. Can I somehow set them to be relative and in case the NPC subtitles get too long the response options would appear lower relatively.

Also I was inspired by Divinity 2 and how they made their dialogue UI. I want the answer options to be grey by default, but when the player puts their mouse upon it, it goes white, is that possible with the system? I only found similar options on the buttons, but I'm not using them, because of visual preference.

Thanks in advance!!!

Re: NPC subtitle and response menus intersecting

Posted: Wed Jun 07, 2023 7:18 am
by Tony Li
Hi,

Yes, you can do all that with standard Unity UI, which is what the dialogue UI uses.

To prevent the NPC subtitle from intersecting the response section, put them both in a Vertical Layout Group. See the WRPG template dialogue UI for an example. It has a Scroll Rect, too, but the Scroll Rect isn't required. The WRPG template dialogue UI accumulates text as the conversation progresses. If you don't want to accumulate text, inspect the subtitle panel(s) and untick Accumulate Text.

To make the answer options grey by default, assign the text element (Text or TextMeshProUGUI) to the Button's Target Graphic field. Set the text element's color to white (255, 255, 255). On the Button, set the Normal color to grey and the Selected and Highlighted colors to white.

Re: NPC subtitle and response menus intersecting

Posted: Wed Jun 07, 2023 8:44 am
by ujuj04
Hey thanks a lot for the help! A question: in WRPG the NPC name is changing between player and NPC, how do I only keep NPC name?

Re: NPC subtitle and response menus intersecting

Posted: Wed Jun 07, 2023 11:51 am
by Tony Li
Hi,

Inspect the subtitle panel, and tick Only Show NPC Portraits.

Re: NPC subtitle and response menus intersecting

Posted: Thu Jun 08, 2023 3:50 am
by ujuj04
yep, it helped, thx!

Re: NPC subtitle and response menus intersecting

Posted: Thu Jun 08, 2023 8:01 am
by Tony Li
Glad to help!