views:

128

answers:

1

I love this feature (well, my son loves it), and I would like to implement it in a kid's book app I am doing for iPhone, but I'm clueless where to begin. I'm using Cocos2d for all the animated sprite/transition stuff, but I'm not sure how to approach highlighting text as it is narrated.

Example: "Jack and Jill, drank their fill, and were too drunk to go for water." As the text is narrated (.mp3 plays on each page), the text would be highlighted. I considered investigating Core animation, but I"m more familiar with Cocs2d at this point (tenuously at best).

If someone has a clue, I'd really appreciate it.

Brendang

A: 

Use the UIStringDrawing methods to determine the rect needed for the highlight, and then position a semitransparent UIView (or whatever cocos2d uses) under your text view. Synchronize with your audio via NSTimer

rpetrich
Thanks for the tip, really appreciate you taking the time to reply. I've thought about trying to do it manually, but with 800+ words, it didn't seem particularly time efficient.best,B.
You will have to make an index of time codes to highlight rect area (or if you have adjustable text size, substring range), and have your code read that.
rpetrich