在 EAGLView 之上创建覆盖视图

发布于 2024-10-02 03:44:27 字数 241 浏览 0 评论 0原文


我正在使用 OpenGLES 创建游戏。
游戏由视图控制器和 EAGLView 组成。
我创建了另一个视图控制器,我想处理 EAGLView 之上的额外视图,例如菜单和选项。 我从 EAGLView 视图控制器调用额外的视图控制器,将 IBOUTLET UIView 添加到 appdelegates 窗口,但它没有出现。正在调用方法,但没有添加视图。
可能是一个非常简单和愚蠢的问题,但我无法解决。
感谢您提前提供的任何帮助

I am creating a game using OpenGLES.
Game consists of a view controller and the EAGLView.
I have created another view controller that I want to handle the extra view that go ontop of the EAGLView so things like menu and options.
I have a call from the EAGLView view controller to the extra view controller that adds an IBOUTLET UIView to the appdelegates window however its not appearing. The methods being called but no view is being added.
Probably a really easy and stupid question but I cant work it out.
Thanks for any help in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

悸初 2024-10-09 03:44:27

好吧,我用不同的方式做到了。
我使用名为 GameViewController 的视图控制器进行加载,并将其子视图添加到 appDelegates applicationDidFinishLaunching 方法中的窗口
然后我调用一个方法将另一个视图控制器视图(我的打开的 gl 视图)添加到子视图中。这意味着我可以将其他视图置于顶部。
说实话,我不知道为什么我之前没有这样做
感谢您的帮助

Ok I have done it a different way.
I use a view Controller called GameViewController to load up and i add its subview to the window in the appDelegates applicationDidFinishLaunching method
Then i call a method to add another view controllers view (my open gl view) to the subview. This means I can then put other views over the top.
I don't know why i didn't do this before to be honest
Thanks for your help

我为君王 2024-10-09 03:44:27

这句话能说得更具体一点吗:

我从 EAGLView 视图控制器调用额外的视图控制器,该控制器将 IBOUTLET UIView 添加到 appdelegates 窗口,但它没有出现。

一种方法是使用导航控制器,该控制器可以以 EAGLView 控制器作为根进行初始化。因此,您可以在导航控制器中推送和弹出另一个处理游戏菜单的视图控制器。

另一种方法是将菜单呈现为模态视图控制器。这可以通过当前 EAGLView 控制器中的presentModalViewController: 来调用。

Can you be more specific with this sentence:

I have a call from the EAGLView view controller to the extra view controller that adds an IBOUTLET UIView to the appdelegates window however its not appearing.

One approach is to use navigation controller that could be initalized with EAGLView controller as root. So, you can push and pop in navigation controller another view controller that handles the game menus.

Another approach is to present menu as modal view controller. This can be invoked with presentModalViewController: in current EAGLView controller.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文