cocos2d convertToWorldSpace -


i'm not sure converttoworldspace works.

  • i have spritea parent.

  • i set position 40,40 example , add scene.

  • i have second spriteb set @ position 80,80.

  • i add spriteb spritea.

  • i print out position of spriteb: 80,80.

  • i print [self converttoworldspace:spriteb.position]. and, still 80,80. shouldn't spriteb position different here?

in case if want know position of spriteb in current world must call "converttoworldspace" methods parent (the spritea) :

[spritea converttoworldspace:spriteb.position];

the "converttoworldspace:" method applies node's transformation given position. should call methods parent's sprite.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -