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

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -