Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would create a new project using the template, and compare it to your own project. For a list of files to compare, and a rough procedure:</p> <ol> <li>Copy all cocos2d files from the template over to your project</li> <li>Check Info.plist, and make any necessary changes</li> <li><p>Modify <code>main.m</code> in your target to specify your <code>AppDelegate</code> class. For a project called Untitled, you'd use</p> <pre><code>int retVal = UIApplicationMain(argc, argv, nil, @"UntitledAppDelegate"); </code></pre></li> <li><p>Add a target that builds the cocos2d files. This will be a "Static Library" target. use "Get Info" on the template version to figure out exactly what's going on inside.</p></li> <li>Link required frameworks to your target: CoreGraphics, OpenGLES, QuartzCore, OpenAL, AudioToolbox, libz.dylib, AVFoundation. I think this is all</li> <li>Use "Get Info" on the template target and your target, and make sure you've added the cocos2d library to "Linked Libraries". Also, add "cocos2d libraries" as a linked target.</li> <li>Compare AppDelegate files, and check how the project is instantiated. The main difference is that you won't be using a <code>Window.xib</code> file to boot up the project, and will have to manually instantiate the cocos2d stuff. The best way to see the proper startup procedure is to take a look at the template code.</li> </ol> <p>That said, I actually DO use a <code>UINavigationController</code> and a <code>UIViewController</code> with a nib file for my initial view. To do this, instantiate the <code>navController</code> like usual, and use this sort of code to attach it to cocos2d: </p> <pre><code>[[[[CCDirector sharedDirector] openGLView] window] addSubview:navController.view]; </code></pre> <p>That should be everything you need to do for a basic conversion.</p> <p>If you want access to the project internals, you might use <a href="http://www.clintharris.net/2009/iphone-app-shared-libraries/" rel="nofollow">the method of shared libraries</a>, which will allow you to build a new cocos2d library every time you build your app. The link has a great tutorial on this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload