Page 1 of 2

Text wrapping and typewriter effect.

Posted: Wed Sep 18, 2019 8:34 am
by KarolStolaDD
Hi! I'm currently using a typewriter effect and I've noticed that it's current behaviour doesn't predict the length of the next word, making it jump to the other line during typing if it exceeds the boundries when line wrapping is on. Is it possible to somehow avoid this i.e. make a word appear in the appropriate line from the beginning?

Re: Text wrapping and typewriter effect.

Posted: Wed Sep 18, 2019 10:33 am
by Tony Li
Hi,

It sounds like maybe you're using a legacy typewriter script. Are you using Unity UI Typewriter Effect or TextMesh Pro Typewriter Effect? These predict line breaks properly.

Re: Text wrapping and typewriter effect.

Posted: Mon Sep 23, 2019 5:15 am
by KarolStolaDD
I'm using Unity UI Typewriter Effect and I think I've found a problem. The case of jumping to the next line seems to occur when I have an autoscroll option enabled.

Re: Text wrapping and typewriter effect.

Posted: Mon Sep 23, 2019 8:56 am
by Tony Li
Hi,

I'll investigate. In the meantime, the autoscroll option is generally no longer needed. You can add a UIScrollbarEnabler to the Scroll Rect, and it will handle scrolling for you.

Re: Text wrapping and typewriter effect.

Posted: Mon Sep 23, 2019 11:24 am
by KarolStolaDD
I've just tried adding the UIScrollbarEnabler to the ScrollRect and assigning the appropriate fields, but I clearly must be doing something wrong, as it doesn' t scroll at all.

Re: Text wrapping and typewriter effect.

Posted: Mon Sep 23, 2019 5:16 pm
by Tony Li
Is your scrollbar's Direction dropdown set to Bottom to Top? If not, please try that. Also try moving the UI Scrollbar Enabler to the GameObject that's the parent of the ScrollRect.

Re: Text wrapping and typewriter effect.

Posted: Tue Sep 24, 2019 3:12 am
by KarolStolaDD
Still no dice. I include the scene on which I test it.

Re: Text wrapping and typewriter effect.

Posted: Tue Sep 24, 2019 10:01 am
by Tony Li
Sorry, the documentation for auto-scroll needs a little work. I'll address that in the next documentation release.

Here's an updated scene. I made these changes:

1. Assign SizerText to Text's Auto Scroll Settings > Sizer Text and ticked Auto Scroll Enabled.

2. Added a Layout Element to Text and ticked Ignore Layout. This allows the Content to size itself based on Sizer Text.

3. Added a Content Size Fitter with Vertical Fit set to Preferred Size to Content. Added a Vertical Layout Group with both Control Child Size checkboxes ticked and no other checkboxes ticked.

Re: Text wrapping and typewriter effect.

Posted: Tue Sep 24, 2019 10:29 am
by KarolStolaDD
Looking good, thanks!

Re: Text wrapping and typewriter effect.

Posted: Tue Sep 24, 2019 10:35 am
by Tony Li
Glad to help! Thanks for the funny text in the example. It gave me a chuckle as I checked out the scene. ;)