views:

43

answers:

2

Hi,

Can anyone tell me the best way to add a viewcontroller with nib file to a cocos2d scene?

Thanks

+1  A: 

UIView can be added to another UIView but not to cocos2d scene (CCScene). You can use openGLView from CCDirector class for your purpose.

[[CCDirector sharedDirector].openGLView addSubView:yourView]
lechec
A: 

actually it is..

[[[CCDirector sharedDirector] openGLView] addSubview:myView];
Rony