Configure CCFileUtils to work with SpriteBuilderĬCFileUtils *sharedFileUtils = (void)applicationWillTerminate:(NSNotification *)aNotification (void)applicationDidFinishLaunching:(NSNotification *)aNotification #import AppDelegate (weak) IBOutlet NSWindow AppDelegate Implement your app delegate which includes the basic steps for setting up the resources search paths and initializing the CCDirector . Add an outlet named glView to your app delegate.ġ0. Set OpenGLView properties of your recently added view:ĩ. Also, I did set the size of the window and view to 480×320 since we will use the resources optimized for a phone display.Ĩ. Set the Custom Class of this view to CCGLView . Go to MainMenu.xib, click on the window object and add a OpenGL View as a new subview. The next steps are dealing with the setup of your main window and view. Especially the resources generated by SpriteBuilder need to be added to your target.ħ. game scenes, game logic, etc.) and your resources. Here you simply need to check the Target Membership for your source files (e.g. Add resources and source code to your new OS X target. Add Other Linker Flags -ObjC -lz to your target Build Settings.Ħ. "Source/libs/cocos2d-iphone/external/ObjectAL"ĥ. "Source/libs/cocos2d-iphone/external/kazmath/include" Add following paths with type recursive: "Source/libs/cocos2d-iphone/cocos2d" We do this at the Build Settings of the MyGameOSX target. Next, we need to set up some header search paths for Cocos2D. Add additional frameworks like Foundation, AudioToolbox, OpenAl, AVFoundation, QuartzCore, AppKit, OpenGL, GameKit, libz.dylib.Ĥ. Additionally, head over to MyGameOSX target settings and link the static library libcocos2d.a (from the cocos2-osx project).ģ. For that, simply drag an drop cocos2d-osx.xcodeproj (can be found at Source/libs/cocos2d-iphone ) to your libs folder within XCode. Now we have to add the Cocos2D-OSX library to our new target. For this showcase, I will use MyGame and MyGameOSX as target names.Ģ. First of all add a new OS X target within XCode and use the Cocoa Application template. You can find the complete project and all resources used for this tutorial at the OSXEnable github repository.ġ. The following system configuration was used for this tutorial. Since there is an ever-growing community around SpriteBuilder, I think there will be soon a native solution to generate OS X targets right out of your SpriteBuilder project. Nonetheless, for now we have to do it by hand. However, there are some real pitfalls to watch out for. So you finished and polished your game for iOS by using Cocos2D and SpriteBuilder? Wouldn’t it be nice to publish your game on the Mac AppStore too? These tools and frameworks make it really simple to accomplish this project successfully.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |