Sprite tag causes text to be truncated.
Closed this issue · 8 comments
Using a sprite tag causes the text to be truncated (i.e. not fully typed out).
It looks like this is because the sprites are not included in the totalPrintedChars count, which is derived from the length of the text with all tags removed. So each time you use a sprite tag your text will end up truncated by 1 character.
Thanks for the bug and the initial investigation. Sounds like it wouldn't be too hard to fix, assuming we can make the assumption that a sprite tag always increases number of characters to print by 1 and can be treated as a character when printing (ie TextMeshPro's numCharactersToDisplay treats it as a character).
Thanks for the quick response.
Just an additional note that pausing for punctuation is also affected by this. Using sprites will cause the pauses to not line up with the displayed text.
One (hopefully) last bug I have found with the sprite tag: The delay custom tag is ignored when surrounding a sprite tag. I would assume this applies to all custom tags but I have only tried the delay tag.
I'm not sure if you would rather these be separate issues, but I am commenting them here for now since they are all related to the sprite tag.
I've got a WIP branch for this going. It's almost done, except for an issue I've found where sprites reappear if you print Animation nodes to the same text component. After I fix that I'll merge this in.
Split out the Sprite re-appearing issue as a new issue as it's unrelated: #38
Just made a release that will hopefully resolve this issue. Version 2.4: https://github.com/redbluegames/unity-text-typer/releases/tag/v2.4
Cool! I pulled down your branch earlier to test it out and its been working great.