0

我有一个 GLES 游戏,它没有标准的 UI 元素。它基于来自 GLSprite 的代码,其中包含 UIView 和 AppDelegate(github 上的完整源代码https://github.com/acekiller/iOS-Samples/tree/master/GLSprite/Classes

我遇到的问题是我想添加 GameCenter 功能并需要打开匹配视图,但它们需要我将 UIViewController 传递给它们,而我没有!

我可以在我当前的游戏中添加一个 UIViewController(我真的很乐意这样做,因为我已经对 GLSprite 源进行了一些修改并且不想让新代码工作混乱)以及如何添加它?

谢谢您的帮助。

4

1 回答 1

0

只需将其添加到 applicationDidFinishLaunching 的末尾

UIViewController *vc = [[UIViewController alloc] init];
vc.view = glView;
self.window.rootViewController = vc;
[window makeKeyAndVisible];
于 2013-05-21T14:13:39.870 回答