Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Problem with Line Spacing

A topic by ChuanJianHua created Aug 26, 2020 Views: 576 Replies: 15
Viewing posts 1 to 16

When I modified Line Spacing, and use Auto Pause Full Mode, the last page text exceeded the vertical range.

click space button


Developer

Hey!


Is your Super Text Mesh object's rect transform's height (or vertical limit if this isn't a Unity UI element) set to a multiple of (text size * line spacing)? Auto pause full depends on specific values to work, so hopefully it's just that causing this. Let me know if that doesn't fix the issue!

Yes, I set it,  otherwise some words will be skipped. But the situation I described appeared, like this gif

Developer

Hmm... I'm having trouble reproducing the issue, could you email me a sample scene?

I sent a sample scene . Thank you !

OK, It work fine , and I have  another question, can the line spacing be set to decimal ? When I set it as 1.5 and set height equals  to size * line spacing * line count,  a blank page will appear in the middle. Can you fix it?

Developer

Hmm... that should be possible... I'll go in and take another look at this soon! I also realized I didn't actually fix Auto Pause & Auto Pause Full with this update when I was trying to repro this, so I'll try to get them working again, too... Sorry for the inconvenience!

Developer

I opened up Unity today and found that whatever I was going on about last night seems to be magically fixed now... I've managed to reproduce the issue you're having and I'll see if I can get this to work.

Has the problem been solved?

Developer

Not yet, it's proving to be difficult... I'm still stuck on figuring out why text is disappearing at certain points when reading. The position should be "locked" before it even reads out, so I'm not yet sure why it's disappearing when it gets to a certain point.

We need this feature urgently hope it can be resolved soon. Thank you.

Developer

Hello,


I am still working on it... This is proving to be a really difficult issue to solve and debug in the first place...

For the time being, I have a temporary solution that might work! It's a bit messy, but I understand making stuff work in a certain time frame is super important!

If you set the vertical limit mode to "cut off" instead of "auto pause full", any extra text that's cut off by the mesh will be stored in a variable named "leftoverText". You can take this string and send it back in to .text to emulate Auto Pause Full! You'll know there's no leftover text to show when "leftoverText" has a length of 0!

Uh, when will this problem be solved? Trying to use the temporary solution also takes me a lot of time, I don’t want to do this ... .

Developer (1 edit)

Here, I went ahead and wrote it up for you!

https://pastebin.com/jRQPfBwr


Add this as a component to your scene, drag in the SuperTextMesh object you're using, and then instead of calling Continue() on SuperTextMesh, call Continue() here! It'll still return false when there's no more text left to show.


I'm still trying to figure out the real solution to this... I might just implement code like this directly into STM or something, because this feels more reliable?

Developer

Hey! Was going through old form posts and thought I'd say, I finally finally got this working!