Page 1 of 1
Text indentation
Posted: Tue Dec 17, 2019 11:16 am
by hearsedriver
Hi,
I've just started using Dialogue System. One inspiration for the visual appearance of the dialogue UI is Disco Elysium.
Can you tell me how text indentation like on
this screenshot could work?
Thanks
Matt
Re: Text indentation
Posted: Tue Dec 17, 2019 1:14 pm
by Tony Li
Hi Matt,
Thanks for using the Dialogue System!
Please see
this post. (Briefly: Use TextMesh Pro and the <indent> tag.)
Re: Text indentation
Posted: Tue Dec 17, 2019 5:56 pm
by hearsedriver
Thanks Tony, that worked and also gave me an idea how/where to uppercase the speaker names. And glad to see that all the pitfalls are well documented! (Enabling TMP support, rewiring subtitle reference, reimporting directories)
I have one issue, though. I unticked "Add Speaker Name" and cleared the "Add Speaker Name Format" as I understand this is now handled by the OnConversationLine method. Yet, the speaker name and the following subtitle text overlap. It looks as if the 10% indentation is applied to the first line already:
- Screenshot 2019-12-17 at 23.52.20.png (148.15 KiB) Viewed 1206 times
I use the code from your post (plus ToUpper() on the speaker name), the Dialogue Text of this conversation is defined as:
Code: Select all
"Guten Abend, werter Herr! Herzlich Willkommen im Hotel zur Post! Ich hoffe, Sie hatten eine bequeme Anreise?"\.
...
If I understand the
TMP indent documentation correctly, the indentation is indeed applied on the first line already? (The space between "1." and "It is" in their sample image doesn't seem to be a regular space.)
EDIT: Another effect I'm seeing is that the TMP Typewriter Effect pauses in the middle of a line.
Any pointers?
Matt
Re: Text indentation
Posted: Tue Dec 17, 2019 6:46 pm
by hearsedriver
After digging into the TMP source code, I found a solution that seems to be working as expected. In TMP_Text.cs line 8342 of TMP preview.2 2.1.0, I changed
to
Code: Select all
if (m_xAdvance < tag_Indent)
{
m_xAdvance = tag_Indent;
}
Meaning: only if the cursor is not yet further than the requested indentation, move it to the desired position; otherwise ignore it for the current line.
- Screenshot 2019-12-18 at 00.42.07.png (150.82 KiB) Viewed 1202 times
I am just leaving this here because it might help other Dialogue System users, but it's probably more a bug / suggestion for improvement for the TMP forums. Also, it needs refinement in case of RTL texts.
Tony, the typewriter pause issue still persists, though. Any advice appreciated!
Matt
Re: Text indentation
Posted: Tue Dec 17, 2019 8:49 pm
by Tony Li
Hi,
I'm back in the office and see you started a
separate thread for the typewriter topic. I'll check it out and reply there.