Page 1 of 1

Have text Start on second line

Posted: Thu Jun 30, 2022 3:10 pm
by StephenC
I would like to implement something similar to the example I've attached. In this example, the character's name is displayed on line one, then the text begins on line 2.

Currently, in my own project I have "Add Speaker Name" checked in the Standard UI subtitle panel. Below I have the box "Add speaker Name Format" which has the default value of {0}: {1}

I'm wondering if it is possible using this field to tell the system to put the character name on the first line, then on the next line start the dialogue text?

I'm not very good with code, so I'm hoping a solution is possible without needing a custom script. Thanks for any advice!

Re: Have text Start on second line

Posted: Thu Jun 30, 2022 4:03 pm
by Tony Li
Hi,

There are two ways to do it:

1. Add the Portrait Name as a separate GameObject. In the screenshot below, I used a Vertical Layout Group:
nameOnTop1.png
nameOnTop1.png (42.44 KiB) Viewed 220 times

2. Or include a new line character in the Add Speaker Name Format, so make it:

{0}\n{1}



The advantage of #1 is that you can style the Portrait Name and Subtitle Text separately.

The advantage of #2 is that it's simpler.

Re: Have text Start on second line

Posted: Thu Jun 30, 2022 4:30 pm
by StephenC
Thank you so much for your quick response. Exactly what I was looking for!

Re: Have text Start on second line

Posted: Thu Jun 30, 2022 8:01 pm
by Tony Li
Glad to help!