Paste cocos2D into a UIKit app

I have already created an iPhone app using UIKit. However, for one part of my application, I will need to perform relatively heavy graphics (particles, lots of moving images). Due to my deadline, I cannot rewrite the entire application in cocos2D. This is just for graphic purposes, and I will not enter the user through cocos2D. Another option I have been considering is to use a simple openGL, but I'm sure cocos2D will be easier to learn.

In short: how can I use cocos2D in a small part (say, one UIView) of my application without rewriting it? (No user interaction required).

Edit: I found out after a while more search. For the record, if anyone needs it in the future: http://www.cocos2d-iphone.org/forum/topic/4708

http://www.cocos2d-iphone.org/forum/topic/9239

+4
source share
1 answer

Include cocos2d in your project first.

  • Copy the cocos2d directory to your project from the downloaded cocos2d-iphone.
  • Edit cocos2d / ccConfig.h, #define CC_FONT_LABEL_SUPPORT 0
  • Copy fps_images.png into your project from the downloaded cocos2d-iphone / Resources / Fonts if you want to show the FPS that is implemented in cocos2d.

Then we implement the use of cocos2d as cocos2d-iphone / tests / attachDemo / attachDemo.m .

+3
source

Source: https://habr.com/ru/post/1346545/


All Articles