[Feature suggestion]: Automatic subtitle line feeds

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

[Feature suggestion]: Automatic subtitle line feeds

Post by Abelius »

Hi there Tony,

I have a suggestion regarding text formatting. I don't actually know if this would be possible, but it's an "issue" (more like an annoyance) I've been having since always.

Both PC and NPC Subtitle Line text controls in my current main game project are set up without a background text "box" texture. This means that there isn't any reference as to where the text is going to bet cut and continue on the next line.

So... sometimes, I've got texts like this:

Image

As you can see, that's not very aesthetically pleasing...

So, I was wondering if some kind of mechanism could be put in place, that for every NPC or PC dialogue line, it analyzed the full text and divided it as in many lines needed so it showed something like this instead...:

Image

That's better to the eye IMHO.

It should also be capable of inserting as many line feeds so every line it's more or less the same length, so if the phrase is even longer and wasn't going to fit in just two lines, it should insert two so we get three lines.

Now... I know I'm asking for something quite weird that not many people will use. And I'm sure you have you hands full as it is now. So, if you don't see an easy way to achieve this, please disregard my suggestion! ;)

Thanks for reading.
Unity 2019.4.9f1
Dialogue System 2.2.15
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: [Feature suggestion]: Automatic subtitle line feeds

Post by Tony Li »

I'll give this some thought. It seems like something that would best be implemented as a general-purpose text sizer, not something specific to the dialogue UI. It could determine if the text would wrap to a second line. If so, choose a blank space about midway and insert a line break. If the text would wrap to three or more lines, you probably don't need to do any special processing, since the first two lines should look about equal in length.
User avatar
Abelius
Posts: 318
Joined: Fri Jul 21, 2017 12:45 pm

Re: [Feature suggestion]: Automatic subtitle line feeds

Post by Abelius »

That's more or less what I was thinking, yup. But I don't know how best to approach the subject from a technical perspective. I'll leave that to you being the genius you are. :lol:

That feature would do wonders for my special case where I'm using a centered paragraph alignment. Until now, what I'm doing is to review every dialogue node at runtime, and manually inserting those line feeds so the dialogue looks "pretty" enough. But that approach, apart from time-consuming, it's also problematic if I want to change the font size or style, as any adjustments I did would be inaccurate for the new font.

Nevertheless, as I said, if this proves to be too difficult I could live without it, I guess. :roll:

Thank you!
User avatar
Tony Li
Posts: 22061
Joined: Thu Jul 18, 2013 1:27 pm

Re: [Feature suggestion]: Automatic subtitle line feeds

Post by Tony Li »

Since this isn't specific to the Dialogue System, I'll need to make it a lower priority. But I'll try to make time to write up a component that does prettier line feeds.
Post Reply