Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.29k stars 344 forks source link

DOMaxVisibleCharacters() doesn't omit RTF characters from timing calculation #653

Closed shadiradio closed 10 months ago

shadiradio commented 10 months ago

If you have a TMP_Text field with some rich tags, DOMaxVisibleCharacters(n, time) will spread the source RTF value over time, instead of the final character output. That means if you have something like:

"Lorem ipsum dolor sit amet, consectetur <color=#f90>adipiscing</color> elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."

If you query IsPlaying() it can still be true even though all text is on the screen, because it counts all the characters in the RTF tags like <color> in the timing calculation. This also means easing doesn't really work right. At least I think this is what's happening.

shadiradio commented 10 months ago

My mistake, I was tweening to the incorrect end value for the total number of characters. This is not a bug.