UI: Keep the first line of the new dialogue in a certain position

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Lucas
Posts: 2
Joined: Mon Jul 11, 2022 2:24 pm

UI: Keep the first line of the new dialogue in a certain position

Post by Lucas »

Hi Tony,
I'm using a Scrolling Dialogue UI (Standard Dialogue UI) with the dialogue accumulated. What I'm trying to achieve is that whenever a new segment of dialogue pops up, I want it to scroll up at a specific position. Is there a way of doing this?

Image
For instance, I want "Feng: You've taken care of your" in the 6th line when it pops up.
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI: Keep the first line of the new dialogue in a certain position

Post by Tony Li »

Hi,

I don't quite follow. But this may be something where you need to do a little scripting. You could make a subclass of StandardUISubtitlePanel and override the ShowContent method to change its default behavior.

If that doesn't help, can you provide a few more mock-up images (e.g., maybe some interim steps) that help clarify what you want to happen?
User avatar
Lucas
Posts: 2
Joined: Mon Jul 11, 2022 2:24 pm

Re: UI: Keep the first line of the new dialogue in a certain position

Post by Lucas »

Thx for replying!
Sure. Here is a mockup of what I mean. The red arrow indicates the position I want the new subtitle to stay at.

Image

Let me know if I'm making myself clear :)
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI: Keep the first line of the new dialogue in a certain position

Post by Tony Li »

What if you were to set it up like this?

LucasUI.png
LucasUI.png (176.24 KiB) Viewed 155 times

You'd want to either make a subclass of StandardUISubtitlePanel and override SetContent(), or add a separate script with an OnConversationLine() method. In either case, you'll want to create an additional Text/TextMeshProUGUI element for the "history" text at the top. Before showing a new subtitle, copy the previous subtitle text into this history text.

Tips:

- Set the "history" text to align to bottom left. Add a Mask so taller text won't be seen above the top of the window.
- UNtick the Clear Text On Close checkbox on the subtitle panel.
Post Reply