Text Highlighting for Storybook Reader

Hey Unity Community,

I have a storybook app written in Flash/Actionscript for Adobe AIR which has a text highlighting engine that highlights text along with a narration audio file which has an array of timecode values to tell the engine which characters need to be highlighted at which times. In addition, when you click on any word it plays an associated audio file from the library.

I’d like to prototype a similar feature in Unity and wanted to ask for some advice on how to proceed. I’m fairly new to Unity, and realize there are more ways to skin this cat than the whiskers on his lip. Okay, I could use some help with my analogies too :wink:

Is there any such thing as live text (as opposed to bitmap text) that can target individual words for color styling, that can figure out which word or characters have been touched by the user?

I see there are some various text tools in the Asset Store - are any of these potentially useful? I’d love to hear if anyone has used any of these tools on a project.

Are there any tools for importing SWF files from Flash I should consider? I know there are some old things out there, but I’d like to find something that can be used that’s being currently maintained and developed.

Thanks in advance for any help you might have for me! As an incentive, I would be happy to share my prototype back with the community for others to learn from or contribute to.

TextMesh Pro is a tool available on the Asset Store which has the capabilities to handle what you describe in terms of text handling / control.

I am bias here since I am the author of TextMesh Pro so I’ll have to hope for one of my user to chime in.

TextMesh Pro does provide you with information about each character, word or line of text via the TextMeshPro.textInfo class and sub structures. With this information you can further manipulate the text to change vertex attributes like colors or positions for instance.

Here is an example of controlling vertex color per word in a block of text while also modifying the vertex position per character.

With regards to detecting user mouseover or something similar, once again since the textInfo class gives you access to information about each character or word, you know their position and thus can implement a method to track a cursor for instance intersecting with a character or word.

Here is a video that explains how this was done.

Thank you Stephan! I’ll check out your product and let you know how it works for me.

You are welcome and if you do end up picking up the product, be sure to register to the TextMesh Pro User Forum to get access to the latest betas with support for Unity 4.6 and the new UI. Most importantly, should you need any assistance, feel free to reach out to me anytime.

if you looking for cheap and more new UI oriented solution (but no serious graphic changes) then i submitted my solution recently: http://forum.unity3d.com/threads/you-feel-that-your-text-is-too-simple-static-solution-here-text-action-pro-pending-review.284109/

Actually status is pending review but as i mentioned in topic there is lite version (free with limited featureset and one-two more bugs which was fixed in PRO version) which you could use as placeholder (you could publish with this if bugs no affect your project as well im good with that case)