IPhone OpenGL ES单个还是多个视图? [英] IPhone OpenGL ES single or multiple views?

查看:164
本文介绍了IPhone OpenGL ES单个还是多个视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑为iPhone编写游戏时最好的方法是什么。游戏将使用OpenGL渲染,但即时通讯好奇创建启动屏幕,菜单的,高分页面等,当你做了这一切与OpenGL或你创造更多的UIViews和使用UIKit的?

I'm confused on what the best approach is when writing a game for the iphone. The game will be rendered with OpenGL , but im curious when creating the Start Screen, Menu's, High Score page, etc. Do you do all of that with OpenGL or do you create additional UIViews and use the UIKit?

推荐答案

我认为没有最佳方法。如果你有时间在OpenGL中编写菜单和高分表,那么你就有了更多的灵活性 - 例如你可以在后台进行3D动画。

I don't think there is a best approach. If you have the time to code up menus and high score tables in OpenGL the you have a lot more flexibility - you could for example have a 3d animation going on in the background.

如果使用标准的UIKit视图对菜单,高分表等进行编码,并在显示OpenGL视图时将其切换出来,那么这样做的优势在于它非常快速代码(特别是如果你花时间学习使用Interface Builder),但它本身就是2d。即使您仍然可以使用自定义按钮图形和字体使其看起来不像商业应用程序,但与应用程序商店中的其他游戏相比,它仍然看起来不那么精致。

If you code menus, high score tables, etc. using standard UIKit views and switch out the OpenGL view while they are shown then this has the advantage that it's very quick to code (esp. if you took the time to learn to use Interface Builder), but it is inherently 2d. Even though you can still use custom button graphics and fonts to make it look less like a business app, it's still going to look less polished compared to other games in the app store.

你不想做的是在你的OpenGL视图顶部层叠一个透明的UIView - 这将是非常慢的。

What you don't want to do is to layer a transparent UIView over the top of you OpenGL view - this will be very slow.

我个人使用Interface Builder生成的视图来获取菜单等内容,而我正在构建程序的其余部分。目的是稍后用OpenGL动画代码替换它。最后,这可能是你有多少时间可用。

I personally use Interface Builder generated views to get stuff like menus in while I'm building the rest of the program. The intention is to replace that with OpenGL animated code later. In the end though, it's really down to how much time you have available.

这篇关于IPhone OpenGL ES单个还是多个视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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