'Embed' cocos2D in UIKit app - iphone

I've already created an iPhone app using UIKit. However, for one part of my app i will need to perform relatively heavy graphica (particles, lots of moving images). I can't rewrite the entire app in cocos2D due to my deadline. It's just for graphical purposes and i won't need user input via cocos2D. Another option i was considering was using plain openGL, but i'm quite sure cocos2D will be easier to learn.
In short: How can i use cocos2D in a small part (say one UIView) of my app without rewriting it? (User interaction is not necessary).
Edit: I found out, after a while more searching. For the record if someone else will need it in the future:
http://www.cocos2d-iphone.org/forum/topic/4708
http://www.cocos2d-iphone.org/forum/topic/9239

First, integrate cocos2d into your project.
Copy cocos2d directory into your project from downloaded cocos2d-iphone.
Modify cocos2d/ccConfig.h, #define CC_FONT_LABEL_SUPPORT 0
Copy fps_images.png into your project from downloaded cocos2d-iphone/Resources/Fonts if you want to show FPS that is implemented in cocos2d.
Next, implement to use cocos2d as cocos2d-iphone/tests/attachDemo/attachDemo.m.

Related

Unity-iOS: Native iOS code development in Unity project?

I am new to Unity. I have done a character walk animation in 3ds max and imported in Unity. I created Xcode project for iOS through Unity, and animation works as expected.
I want to develop some UI button controls on screen and animate this animation in my iOS app, only when this button is clicked. How do i code it now for this UI controls and events? Do i need do adding these controls and events on the Xcode project (which created by Unity) (or) I can do everything like this kind of native code in Unity itself?
Please advise!
Thank you!
Getsy.
You can do all UI in the Unity itself. You have these options:
Old Unity GUI system. It is pretty easy to program, but it is awful in terms of performance and usability for designers — it's created completely from code, with no editors. It's almost never used in commercial products except for debugging and developer tools. However, it's still a good option for prototypes.
Use other GUI package. There are a lot of 2d and UI packages for Unity of all kinds. Currently the most popular one is NGUI, which is pad, but also has an evalution version.
Create your own UI framework (still in Unity). Just wanted to mention that this is a viable option, but it's obviously the worst one for your case.
Wait for the new 2D/GUI Unity framework. It's supposed to come out in 4.3 version, and it is just around the corner; more than that, the original NGUI author is working on it.
In you place, I'd create basic prototype controls with built-in Unity3d GUI, and by the time I'd need to create something more presentable, new Unity GUI would hopefully already be there.

Using 3D objects in an iOS app

How would I go about adding a 3D object from Maya into an iOS app? For now, before it gets too complicated, I just want to add it in, no response to touch yet. Is there a tutorial about this? Thanks!
Edit: It doesn't necessarily have to be Maya. I can learn how to use another program.
Molecules is a great open source iOS app that uses OpenGL ES to render 3D objects that have nice touch interaction. Maybe that would be a good starting point.
Go to Xcode and start an OpenGL-ES Project.
Export your maya-model to *.obj(Wavefront)-format and use Jeff Lamarches obj-loader to create c-header files that you can include into your iPhone project!
For a more modern example of rendering 3D meshes, check out this library. It comes with an OBJ parser, so if you can export your geometry as an OBJ file, you can render and interact with it using the library on iOS. Here's a short video of the library in action.

Does my *Entire* game have to be remade, to use Cocos2D?

I have been making my game in a pretty conventional manner. I just created a new window based application and have built off of that using my own images, table views, etc. Now I am about to begin programming the gameplay, and I just recently discovered Cocos2D. My question is this: In order to use Cocos2D for the actual gameplay (Which would take place in a single view) do I need to recreate my app from scratch? Or can I just make the one view using Cocos2D?
You could go down the mix-and-match route, but it would likely drive you insane.
If you want to embrace Cocos2D, you will likely be better off moving to it fully. More likely than not the time invested will be yield improvements in your existing code that you'll find surprising (certainly, I've found that rewriting something pretty much always yields a better solution in fewer lines of code).
You do not want to keep using the standard SDK in your game, if you're going to use Cocos2D for the game view (which you totally should).
Re-do the entire app in Cocos2D -- you'll have way more possibilities to make your game menus awesome and much less headaches; both while developing and while maintaining your game.

Interface Builder vs Cocos 2D - how choice the best for your app

I was a flash developer for 3 years, and in the last 5 months, i begin the iphone development, i do 2 applications with interface builder for clients, and now i really want to do a little game, is quite simple, one match 3! I made the engine in interface builder, and seens good to me! But after i read some posts, i really want to try it in the cocos2D! So, in 2 days i rewrite all my first engine for cocos2D, very annoying upsidedown coordinates but ok, i really do! But the performance side by side with interface builder version is really scare! Many Many slow downs at the cocos2d side! And the animation seens bugged to me! I really scare! I really don't know what is the best choice for a simple game.
And i want some opinions:
Using cocos2d when need some physics? When we have many objects at screen? What is the performance boost i have with cocos2D?
I have how to share this 2 applications with you guys?! Without your UID?!
cocos2d uses chipmunk, which IMHO is a great physics library if all you need is 2d! Apple doesn't support ad-hoc distribution without knowing the Device ID of the test device!
I think baDa is asking when to use cocos2D and Interface Builder. Since you can develop games using Interface Builder, is it advisable to do so? What are the performance differences between this two approach (cocos2d vs Interface Builder)?
I also had a confusion and ask this to my self when i was just starting to program. After working with several games. I reallized that you can actually combine this two approaches. The big BUT is, when working with objects dynamically (specially with bunch of images) using IB, it totally removes the flexibility of the code. Adding/removing images, adjusting coordinates and replaceing scenes is just too awkward, bulky, and wastefull to implement.
My simpole rule is to use coocs2d for game developemnt and IB for other apps that is reach in interfaces.

Can i use pickerview in my iphone application using cocos2d?

Duplicate:
How can i use picker view in iphone application using cocos2d ?
Hello everyone i am working on iphone gaming project.In this game i want spin some image (like reel spin).But i can not do this.Can i use picker view in this application using cocos2d.If can then give some instruction how can i do that or any different solution for this project.
You can use anything your want. I am constantly amused by the number of people who think that Cocos2d is some sort of world that you enter where you cannot bring any of your old friends. Cocos2d is just a library that makes OpenGL easy for games, and that is all it is. All it is.
I think you might benefit from trying a few easier projects first. I have made the mistake of trying to jump into something beyond my understanding, and while in the end it may have been beneficial, I sometimes wish I had learned in a more systematic manner.