Game Development Reference
In-Depth Information
Figure 15-1 . A UIAlertView is displayed over the cocos2d view
Embedding UIKit Views in a cocos2d
App
Next you'll be embedding more commonly used UIKit views in cocos2d. One of the
simplest and most common is the UITextField , which you'll add on top of
cocos2d, as you've done before. It gets more complicated when you move it to the
background of cocos2d, which requires making the cocos2d view transparent.
Finally, I'll show you how you can add your Interface Builder views into a cocos2d
app, instead of creating the views programmatically.
Adding Views in Front of the cocos2d View
In the CocosWithCocoa01 project, I've added UITextField views on top of the
cocos2d view. The UITextField is a simple text entry box that automatically brings
up the iPhone keyboard when you tap it.
-(void) addSomeTextFields
{
// regular text field with rounded corners
UITextField* textField = [[UITextField alloc] initWithFrame:←
 
Search Nedrilad ::




Custom Search