Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprite tag causes text to be truncated. #35

Closed
Crazymonkay opened this issue Jul 2, 2020 · 8 comments
Closed

Sprite tag causes text to be truncated. #35

Crazymonkay opened this issue Jul 2, 2020 · 8 comments

Comments

@Crazymonkay
Copy link

Crazymonkay commented Jul 2, 2020

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.

@edwardrowe
Copy link

edwardrowe commented Jul 2, 2020

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).

@Crazymonkay
Copy link
Author

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.

@Crazymonkay
Copy link
Author

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.

@edwardrowe
Copy link

edwardrowe commented Jul 2, 2020 via email

@edwardrowe
Copy link

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.

@edwardrowe
Copy link

Split out the Sprite re-appearing issue as a new issue as it's unrelated: #38

@edwardrowe
Copy link

Just made a release that will hopefully resolve this issue. Version 2.4: https://github.com/redbluegames/unity-text-typer/releases/tag/v2.4

@Crazymonkay
Copy link
Author

Cool! I pulled down your branch earlier to test it out and its been working great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants