Using cocos2d for iPhone game development, I am confused between Layer and Scene. For example, My simple game have several ‘UI Pages’ like main menu, highscores, game board etc.
So should I use Layer or Scene for every ‘UI page’, and why?
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.
Reviewing SpritesDemo.m/.h, it would appear that they are using Layer, and then creating new scenes, attaching the layer and then replacing the scene on the director
The code then does the following:
So, in short, the answer to your question would be ‘both’, you use Layer to represent your actual ‘UI Page’, but you attach the Layer to a new scene and replace the current scene in the director.