Rony
Rony

Reputation: 1229

Add viewcontroller in cocos2d scene

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

Thanks

Upvotes: 0

Views: 1116

Answers (2)

Rony
Rony

Reputation: 1229

actually it is..

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

Upvotes: 3

lechec
lechec

Reputation: 839

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]

Upvotes: 1

Related Questions