Text wrapping and typewriter effect.

Announcements, support questions, and discussion for the Dialogue System.
KarolStolaDD
Posts: 6
Joined: Wed Sep 18, 2019 8:18 am

Text wrapping and typewriter effect.

Post 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?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text wrapping and typewriter effect.

Post 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.
KarolStolaDD
Posts: 6
Joined: Wed Sep 18, 2019 8:18 am

Re: Text wrapping and typewriter effect.

Post 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.
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text wrapping and typewriter effect.

Post 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.
KarolStolaDD
Posts: 6
Joined: Wed Sep 18, 2019 8:18 am

Re: Text wrapping and typewriter effect.

Post 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.
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text wrapping and typewriter effect.

Post 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.
KarolStolaDD
Posts: 6
Joined: Wed Sep 18, 2019 8:18 am

Re: Text wrapping and typewriter effect.

Post by KarolStolaDD »

Still no dice. I include the scene on which I test it.
Attachments
SampleScene.unity.zip
(5.19 KiB) Downloaded 140 times
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text wrapping and typewriter effect.

Post 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.
Attachments
AutoScrollSample_2019-09-24.zip
(5.53 KiB) Downloaded 192 times
KarolStolaDD
Posts: 6
Joined: Wed Sep 18, 2019 8:18 am

Re: Text wrapping and typewriter effect.

Post by KarolStolaDD »

Looking good, thanks!
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Text wrapping and typewriter effect.

Post 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. ;)
Post Reply