iphone - how to make a sprite goes behind another sprite -


I am using CCSprite to recreate the background image of my app (it's like moving background ). However, I am also using CCSprite to attract my heroes and enemies. In some cases the enemy goes behind the image of my background. My understanding is that if you do:

  [add- bind: sprite1]; [Adding Child: Phantom 2];  

Then if they pierce each other in the window, then Sprite 2 will be behind. However, is there any way to unveil Sprat 1 in order to penetrate Sprat 2? I tried to see but the cocos2d does not seem to be the method that I see ...

I have not used cocos 2d ... normally if you want to take sprite1 at the top of sprite2

  [self replaceChild: sprite2 withSprite: sprite1]  

Similarly if you want to take sprite2 at the top of sprite1 <<> [place of self between: sprite1 withSprite: sprite2]

You need to change the place of change, method ... common tuwe But if addChild method adds an array element, you have an array, you can use Bdlenobjektaindaks method.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -