Page 1 of 1

Making slight changes to how dialogue displays

Posted: Sat Mar 20, 2021 8:00 pm
by boz
What would be the best way to go about inserting a carriage return between every line of dialogue so I don't have to remember to manually put one at the start of each dialogue box?

I think once I know that I'd probably be able to start also having it insert the actor/conversant names at the top of paragraph as well? If that's a different matter altogether, can you give me any tips on that as well?

Thanks :)

Re: Making slight changes to how dialogue displays

Posted: Sat Mar 20, 2021 8:40 pm
by Tony Li
Hi,

You can add a script with an OnConversationLine method to the Dialogue Manager GameObject. Example:

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;
public class AddLineSpacing : MonoBehaviour
{
    void OnConversationLine(Subtitle subtitle)
    {
        if (!string.IsNullOrEmpty(subtitle.formattedText.text))
        {
            subtitle.formattedText.text += "\n";
        }
    }
}

Re: Making slight changes to how dialogue displays

Posted: Sun Mar 21, 2021 4:29 pm
by boz
Fantastic, thank you!

Re: Making slight changes to how dialogue displays

Posted: Sun Mar 21, 2021 4:50 pm
by Tony Li
Glad to help!