Page 1 of 1

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

Posted: Mon Jul 11, 2022 3:16 pm
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.

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

Posted: Mon Jul 11, 2022 3:29 pm
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?

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

Posted: Mon Jul 11, 2022 4:25 pm
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 :)

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

Posted: Mon Jul 11, 2022 7:27 pm
by Tony Li
What if you were to set it up like this?

LucasUI.png
LucasUI.png (176.24 KiB) Viewed 147 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.