Text wrapping and typewriter effect.
-
- Posts: 6
- Joined: Wed Sep 18, 2019 8:18 am
Text wrapping and typewriter effect.
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.
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.
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.
-
- Posts: 6
- Joined: Wed Sep 18, 2019 8:18 am
Re: Text wrapping and typewriter effect.
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.
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.
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.
-
- Posts: 6
- Joined: Wed Sep 18, 2019 8:18 am
Re: Text wrapping and typewriter effect.
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.
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.
-
- Posts: 6
- Joined: Wed Sep 18, 2019 8:18 am
Re: Text wrapping and typewriter effect.
Still no dice. I include the scene on which I test it.
- Attachments
-
- SampleScene.unity.zip
- (5.19 KiB) Downloaded 150 times
Re: Text wrapping and typewriter effect.
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.
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 200 times
-
- Posts: 6
- Joined: Wed Sep 18, 2019 8:18 am
Re: Text wrapping and typewriter effect.
Looking good, thanks!
Re: Text wrapping and typewriter effect.
Glad to help! Thanks for the funny text in the example. It gave me a chuckle as I checked out the scene.