本文介绍了添加Cocos2D到xCode 4中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个项目中需要在cocos2d中拥有相同的部分(可可触摸)和一些部分。我已经把所有的本机,现在我需要在项目中集成cocos2d。我的问题是,我不能添加成功的cocos2d库到我的项目。
任何好的解决方案呢?我使用xCode 4

解决方案

你本质上有两个选择。



选项1:将cocos2d文件添加到现有项目


  1. 将cocos2d文件添加到项目中

  2. 在View Controller中创建一个EAGLView并将其绑定到CCDirector。

选项2:使用cocos2d模板将现有代码安装到一个新项目中



有XCode 4模板。安装它们:



install-templates.sh --force p>

然后使用XCode中的这些模板创建一个新的cocos2d项目4.添加你现有的文件并更新它创建的项目,你应该很好。



就我个人而言,我有更好的选择#2,但我的大部分代码都很容易移动。


I'm working in a project that need to have same parts native (cocoa touch) and some parts in cocos2d. I have made the all the native and now I need to integrate cocos2d in the project. My problem is that i cant add with success the cocos2d library to my project.Any good solution to do that? I'm using xCode 4

解决方案

You essentially have two choices.

Option 1: Add cocos2d files to your existing project

  1. Add cocos2d files to your project as normal (drag the source files in, copy to dest folder).
  2. Create an EAGLView in a View Controller and bind it to the CCDirector. (See an example project for reference.

Option 2: Install your existing code into a fresh project using the cocos2d templates

The latest version of cocos2d (1.0-RC) has XCode 4 templates. Install them:

install-templates.sh --force

Then create a new cocos2d project using those templates in XCode 4. Add your existing files and update the project that it creates, and you should be good to go.

Personally, I've had better luck with Option #2, but most of my code is pretty easy to move around.

这篇关于添加Cocos2D到xCode 4中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 15:44
查看更多