I am playing in cocos2d and wanted know how can i give a sprite a layer depth meaning how can i keep a sprite on top of others?
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.
You could do something like this:
Assuming your class is a subclass of CCScene
The bit you need to learn how to use is the z: parameter of add child. If you add a child without the z parameter, the child is placed on top.