用于对话的 iPhone RPG 滚动文本 [英] iPhone RPG scrolling text for dialogue

查看:21
本文介绍了用于对话的 iPhone RPG 滚动文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 RPG,但我仍然对显示对话的最佳方式感到困惑.

I have an RPG in development, but I'm still confused about the best way to display dialogue.

我希望有一个带有滚动文本的文本框(就像任何 RPG 一样),但是使用 X-Code 实现此目的的最佳方法是什么?

I want there to be a text box with text that scrolls (like any RPG), but what is the best way to accomplish this using X-Code?

谢谢!

推荐答案

您应该使用 UITextViewscrollRangeToVisible 方法.当你浏览方法时不要忘记它继承自 UIScrollView(所以你也可以使用 UIScrollViewDelegate),它有一些与移动相关的非常有用的方法.

You should use a UITextView and the scrollRangeToVisible method. As you browse methods don't forget it inherits from UIScrollView (so you can use UIScrollViewDelegate too) which has some really useful methods related to movement.

您可以在您的应用中只使用一个 UITextView 并根据需要操纵文本/滚动位置.使用传统动画可以实现各种淡入淡出和效果.

You could probably use just one UITextView in your app and manipulate the text/scrolling position as necessary. Using conventional animation all kinds of fades and effects are possible.

如果你需要各种字体的彩色文本,你需要使用 UIWebView 它不是从 UIScrollView 继承而是 UIView - 所以你的动画方法将更多地基于您可以对 UIView 做的熟悉的事情,但仍然不难.

If you need colored text with various fonts you need to use UIWebView which does not inherit from UIScrollView but UIView - so your animation approach would be based more on familiar things you can do to a UIView but still not hard.

不要忘记使用经典的 RPG 对话框,..." - 但请不要让文字缓慢地、逐个字符地出现,或者有很长的不可跳过的动画 - 通过 Final 的介绍Fantasy Tactics Advance 第二次差点杀了我.

Don't forget to use that classic piece of RPG dialog, "..." - but please don't make text appear slowly, character by character, or have long un-skippable animations - going through the introduction of Final Fantasy Tactics Advance for the second time nearly killed me.

这篇关于用于对话的 iPhone RPG 滚动文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆