Adding Cocos2D only to already existing project?

后端 未结 3 1167
遇见更好的自我
遇见更好的自我 2020-12-15 00:37

I already have a project that is 90% done and I want to add Cocos2D ONLY to it. I do not need Box2D or Chipmunk. How would I do this? What files do I add? I really need this

相关标签:
3条回答
  • 2020-12-15 01:02

    To start the easier way to add Cocos2d into your project is to follow these lines:

    1. Import the Cocos2d files into your project like the picture below: Copy the Cocos2d file into the project

    2. Then import the "FontLabel" folder which is located into the "external" folder (Into the Cocos2d library) like the previous step.

    3. After, you have to link the OpenGLES and QuartzCore frameworks with your project: enter image description here

    4. Next in the "Project navigator", select your target and open the “Build Settings” tab.

    5. Add the -lz flag into the "Other Linker Flags": enter image description here

    That's all! No it should compile properly.

    However I don't if you want to use Cocos2d with the UIKit framework or if you want use it as the main entry. If you want more details about these steps you can check the Ray Wenderlich blog's post.

    I hope it'll help you.

    0 讨论(0)
  • 2020-12-15 01:12

    Create new project with cocos2d and find the libraries folder. Copy that libraries folder into your Xcode project. Provide Header Search Paths

    - "Libraries/Chipmunk/objectivec/include"
    - "Libraries/Chipmunk/chipmunk/include"
    - "Libraries/kazmath/include"
    

    Set other linker flag as - “-lz” Add below given frameworks

    - QuartzCore.framework
    - CoreText.framework
    - AvFoundation.framework
    - AudioToolbox.framework
    - OpenAl.framework
    

    Now compile the code. :)

    0 讨论(0)
  • 2020-12-15 01:12

    This works with the older version of Cocos. For the newer version try this!

    It worked for me!

    http://www.cocos2d-iphone.org/forums/topic/adding-cocos2d-2-0-to-existing-iphone-project/#post-408352

    0 讨论(0)
提交回复
热议问题