I am developing iPhone 2d game by using cocos2d. I need a Picker. Is it possible to use Picker in cocos2d ! If possible then tell me, How can I use a Picker in cocos2d ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can mix and match standard UIView based classes with Cocos2D classes.
In your application delegate, when you started up the Director, you created a UIWindow and attached the Director to it. You can also save a reference to the window in your appdelegate. Now you can create and add UIViews to the Window, as well as manipulate cocos2d nodes as usual through the director.
From here, it’s just a matter of creating a UIPickerView, and adding it to the window. Configuring the UIPickerView is a whole task unto itself… Nitrex88 has a good video on the subject . Also, check out UICatalog for a solid example not just of UIPickerView, but many many more UIView subclasses.
Here’s an example of adding a trivial UIPicker to a cocos2d app: