快速检查如何在 iPhone 游戏中实现多个 UIView

发布于 2024-09-27 10:45:35 字数 266 浏览 0 评论 0原文

我将重组我的游戏以使用多个 uiview。以下流程正确吗?

  • 我创建了 6 个 uiview(每个精灵一个)。
  • 游戏加载 root uiview。
  • root uiview init 方法使用 self addSubview 加载 5 个子视图。
  • 在游戏控制器中,我更新每个游戏的每个 uiview。
  • 游戏控制器需要一个指向每个 Uiview 实例的指针。

谢谢大家,

马丁

I am going to restructure my game to use multiple uiviews. Is the following flow correct ?

  • I create 6 uiviews ( one for each sprite).
  • game loads root uiview.
  • root uiview init method loads 5 subviews using self addSubview.
  • in the game controller I update each uiview each game tic.
  • the game controller will need a pointer to each Uiview instance.

Thanks all,

Martin

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

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

发布评论

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

评论(1

や莫失莫忘 2024-10-04 10:45:35

我可能会使用主视图的 UIViewController 来加载子视图并将它们添加到主视图,而不是直接在主 UIView 本身中加载子视图。

I would probably use the UIViewController for the main view to load the subviews and add them to the main view, not load the subviews directly in the main UIView itself.

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