Overlap Text (and related)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
DLRyy
Posts: 20
Joined: Fri Aug 12, 2022 12:02 pm

Overlap Text (and related)

Post by DLRyy »

There is one tiny thing. When I redesigned one UI prefab the subtitle box and the response box overlapped, it wasn't that big of a change but I'm puzzled as to why, I believe it's the anchoring on the parent object, but still I'll ask.
Ideally, the subtitle box takes priority and it pushes the other one into place so that when the NPC ends, well then you can freely respond.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Overlap Text (and related)

Post by Tony Li »

Hi,

That's a Unity UI question, so it will probably depend on which Unity UI layout components you're using. Did you start with one the prefabs that ship with the Dialogue System? If so, which one?

Can you post of screenshots of your setup?
DLRyy
Posts: 20
Joined: Fri Aug 12, 2022 12:02 pm

Re: Overlap Text (and related)

Post by DLRyy »

Yes I started with the JRPG classic one
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Overlap Text (and related)

Post by Tony Li »

In that prefab, the subtitle panel and response menu panel overlap so the content will be in the same place. When showing a subtitle, the subtitle panel is active. When showing a response menu, the menu panel is active and the subtitle panel is inactive.

If you want the subtitle panel to remain active while showing a response menu, you can do exactly what you said -- move them to different positions, and set the subtitle panel's Visibility to Always From Start or Always Once Shown.

If you want the response menu buttons to appear directly below the subtitle text, you can use Vertical Layout Groups:

jrpgShowSubtitleAndMenu.png
jrpgShowSubtitleAndMenu.png (85.12 KiB) Viewed 331 times

In the example above, I added Vertical Layout Groups to the Text Panel, Subtitle Panel, and Response Menu Panel, with checkboxes configured as shown above, and ticked the same checkboxes on the Response Button Template's Vertical Layout Group. I also ticked the Continue Button's Layout Element > Ignore Layout, and remove the Scroll Rect from the response menu panel. (Side note: This essentially turns it into the same layout as the WRPG prefab.)
Post Reply