Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to build a sprite based game using cocos2d. I will be mostly drawing everything in code. I also want to incorporate iPhone UI widgets such as buttons and such. Can these be created to appear on top of the cocos2d canvas? Will this affect the performance of what is drawn/animated?

share|improve this question
    
Yes, this can be done. stackoverflow.com/questions/3585929/… –  Gob00st Jan 4 '12 at 17:19
add comment

1 Answer 1

You can get the reference to opengl view with: [[CCDirector sharedDirector] openGLView]

With that any UIView's can be added as subview of that opengl view as follows:

UIButton *myButton;
//initialise myButton here

[[[CCDirector sharedDirector] openGLView] addSubView:myButton];
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.