Page 1 of 2

a space between each line of dialogue?

Posted: Fri Nov 15, 2019 10:19 pm
by ar4wy
Hi Pixel Crushers!

I'm new to the asset and I'm trying to figure out something seemingly simple!

Right now, my dialogue looks like this:

-----
ACTOR1: hello something something something
ACTOR2: hello to you too
ACTOR1: nice
-----

How can I make it look like this?

-----
ACTOR1: hello something something something

ACTOR2: hello to you too

ACTOR1: nice
-----

So that there is a break between each character's line of dialogue. I've tried to change line spacing, but it changes all text. Is this is something in the Dialogue panel (modifying the database?) Is there something I can do to format what is being sent to the text component and being shown?

Thanks!

Re: a space between each line of dialogue?

Posted: Sat Nov 16, 2019 7:23 am
by Tony Li
Hi,

Thanks for using the Dialogue System!

You can give the Dialogue Manager a small script with an OnConversationLine method, such as:

DoubleSpaceSubtitles.cs

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;

public class DoubleSpaceSubtitles : MonoBehaviour
{
    void OnConversationLine(Subtitle subtitle)
    {
        subtitle.formattedText.text += "\n";
    }
}
This script adds a blank line at the end of every subtitle before it's send to the dialogue UI for display.

Re: a space between each line of dialogue?

Posted: Mon Dec 02, 2019 8:22 pm
by ar4wy
Thank you! Works great!

Re: a space between each line of dialogue?

Posted: Mon Dec 02, 2019 8:28 pm
by Tony Li
Glad to help!

Re: a space between each line of dialogue?

Posted: Mon Dec 12, 2022 3:25 am
by Olafs Osh
Resurrecting this not-so-old-actually thread.

I understand, that "/n" adds an extra line. But how to modify spacing between the lines more precisely. I would need just a tad, so larger blocks of text are better readable.

- Olafs

Re: a space between each line of dialogue?

Posted: Mon Dec 12, 2022 6:50 am
by Tony Li
Try "<br>" instead of "\n". I think that does a paragraph break in TextMesh Pro (although it's a line break in standard HTML). Then you should be able to set the paragraph spacing amount in your TextMeshProUGUI.

If that doesn't work, then instead of "\n" you could try a line break with a smaller font size: "<size=50%><br><size=100%>"

Re: a space between each line of dialogue?

Posted: Mon Dec 12, 2022 8:37 am
by Olafs Osh
Heh. Upon running the thing, it writes Subtitle properly and then switches to this oddly looking stuff:
[img] - ds01.jpg


Just "<br>" goes like this..
[img] - Screenshot_20.jpg


The winner is "\n", but, yep, it's too much...
[img] - Screenshot_21.jpg

Re: a space between each line of dialogue?

Posted: Mon Dec 12, 2022 10:05 am
by Tony Li
Are you using TextMesh Pro? Make sure your TextMeshProUGUI allows rich text tags.

Re: a space between each line of dialogue?

Posted: Tue Dec 13, 2022 2:00 pm
by Olafs Osh
Kinda...
Screenshot_22.jpg
Screenshot_22.jpg (84.57 KiB) Viewed 1131 times

Re: a space between each line of dialogue?

Posted: Tue Dec 13, 2022 2:17 pm
by Tony Li
Maybe, instead of the extra rich text tags, it would be sufficient to use only "\n" as before but increase the TextMeshProUGUI's Spacing Options > Line value.