为什么在 2D iPhone 游戏中使用 Cocos over UI Kit?游戏中、Cocos、iPhone、Kit

2023-09-06 10:06:26 作者:花舞花落泪

我在 cocos 中构建游戏已经有一段时间了,我突然想到使用 UIKit 可能会容易得多.

I have been building a game in cocos for a while now I it has just occurred to me that it might just be a whole lot easier to use UIKit.

能否请您帮我权衡利弊,并分享您的一些经验.

Could you please help me weight up the pros and cons, and share some experiences you have.

以下是我列出的每种优势的基本列表.我觉得我对 cocos 的了解还不够,无法做出最好的明智决定.

Here is my basic list of advantages for each. I feel I dont know enought about cocos to make a informed decision which is best.

可可

游戏引擎免费提供.每帧暂停/恢复回调精灵动画使用 open GL(这是真的吗?这是优势吗?)...帮我想想更多!

用户界面工具包

更多帮助/文档/示例代码熟悉 iPhone 程序员易于触摸轻松查看动画易于定制加载时间更快?(这是真的吗?)

任何反馈都会很棒!

编辑:我刚刚看过一个开发者视频(在一个名为 Quest 的开放式 GL 游戏中),他们使用 UI Kit 作为 UI 元素,绘制在 GL 视图的顶部.这对 cocos 是否可行/实用?

EDIT: I have just seen a developer video (on an open GL game called Quest) where they used UI Kit for the UI elements, drawn over the top of the GL View. Is this possible / practical with cocos?

推荐答案

Cocos2d 使用 OpenGL 来绘制它的精灵、运动和粒子.尝试使用 Quartz/Core Graphics(未加速!)从根本上来说速度要慢得多且耗电.Cocos2d 是一个 sprite 库,首先是一个场景图.您将重复使用 UIKit 制作场景图.在 Cocos 中有很多不错的免费赠品,您必须从头开始开发.

因此,简而言之:它的绘制速度比 CPU 绑定的绘制调用快,它提供了大多数基于 sprite 的游戏所需的 95%,而无需一遍又一遍地重新发明相同的东西,而且是免费的.

So, in short: It draws way faster than CPU bound drawing calls, it provides 95% of what most sprite based games need without reinventing the same thing over and over, and is free.