问题描述
我已经从他们的网站下载最新的cocos2d,我已解压缩它。现在我很困惑,如何实现它到一个已经存在的项目。
I have downloaded the latest cocos2d from their site, and I have unzipped it. Now I am confused exactly how to implement it into an already existing project. What files do I drag over and is there anything else I have to do besides that?
谢谢!
推荐答案
您可以将cocos2d链接到您的项目中,如下所示。他使用支持弧的特殊版本,但它的工作方式与原始版本完全相同。然后在下一步中确保您导入所有重要的库:
You can link cocos2d into your project as shown here. He uses a special version that supports arc, but it works in exactly the same way with the original version. Then in a next step make sure that you import all the important libraries:
- QuartzCore.framework
- OpenGLES.framework
- AVFoundation.framework
- UIKit.framework
- Foundation.framework
- CoreGraphics.framework
- QuartzCore.framework
- OpenGLES.framework
- AVFoundation.framework
- UIKit.framework
- Foundation.framework
- CoreGraphics.framework
如果使用声音,您还需要:
If you use sound you also will need:
- Openal.framework
- AudioToolbox.framework
- libcocosDenshion.a
现在您需要设置一个支持OpenGL的rootview。看看Hello World例子,他们是怎么做到的。您现在应该能够在屏幕上实现和显示Cocos2d场景。
Now you need to set up a rootview that supports OpenGL. Look at the Hello World example how they did this there. You should now be able to implement and display Cocos2d scenes on screen.
这篇关于如何实现Cocos2D?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!