iPhone RPG scrolling text for dialogue

2019-07-26 02:41发布

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

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?

Thanks!

1条回答
Viruses.
2楼-- · 2019-07-26 03:03

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.

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.

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.

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.

查看更多
登录 后发表回答