In my game, I use Cocos2D for physics in the gameplay and UIKit for the menu screen and the rest of the game. Now, I have to pass the data from a UIViewController to a Cocos2D scene. Is there a way to do this?
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.
I think you can do it by assigning value to a class variable….
Code snippet will look like this…
in your
GameScene.mSomething like this may help.. I did this in cocos2d-x and it works fine.. M sorry for syntax as I don’t have X-code…. 🙂