convertToWorldSpace - cocos2d -


  • converttoworldspace

hi, i'm not sure understand how works. api states converts local coordinate world space.

let' have 3 sprites. spritea added scene , , spriteb added spritea. , spritec added spriteb.

- scene     - spritea         - spriteb             - spritec 

and want convert spritec origin world

if do: [self converttoworldspace:[spritec cgpointzero]];

or this: [spritea converttoworldspace:[spritec cgpointzero]];

or this: [spriteb converttoworldspace:[spritec cgpointzero]];

or [spritec converttoworldspace:[spritec cgpointzero]];

shouldn't give same answer since transformed world coordinates? or go 1 node space parent node space ...until world space.

what correct answer see spritec position in world coordinates?

to find world space origin on spritec, take sprites parent, in case spriteb , ask world space of child:

[spriteb converttoworldspace:[spritec cgpointzero]]; 

Comments

Popular posts from this blog

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

mysql - How to insert just year and month into date field? -