突出显示朗读文本(在 iPhone 的故事书类型应用程序中)

Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
本文介绍了突出显示朗读文本(在 iPhone 的故事书类型应用程序中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

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

这篇关于突出显示朗读文本(在 iPhone 的故事书类型应用程序中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How to stop UIBarButtonItem text from truncating?(如何阻止UIBarButtonItem文本被截断?)
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type(异常:不应为错误类型创建SimpleTypeImpl)
Android Adding a button with multiline text inside MaterialButtonToggleGroup doesn#39;t work(Android在MaterialButtonToggleGroup中添加多行文本的按钮不起作用)
Switch Status Bar Text Color / setAppearanceLightStatusBars of WindowController is not working as expected(开关状态栏文本颜色/设置外观WindowController的LightStatusBars未按预期工作)
How to change status bar icon and text color in flutter based on theme been set?(如何根据已设置的主题更改颤动中的状态栏图标和文本颜色?)