Dear All
I have been working on implementing Box 2d into my Cocos2d-iphone game - and have hit one minor snag.
My sprites have an anchor point that is at 75% of y. So instead of being dead center, it is centered on the X - and 3/4s up on the Y.
So when you try to line the sprite up with the body/shape - it is offset.
With the Chipmunk code I was using, allowed me to offset the body/shape so that it lined up perfectly - and I could then move it and rotate it no worries.
Have I missed a way of setting the point of origin or anchor point somewhere?
Do I have to roll some maths code to calculate the offset (taking into account the rotation) - not sure if I still have enough skills!
Any ideas.
Thanks
Justin
I have been working on implementing Box 2d into my Cocos2d-iphone game - and have hit one minor snag.
My sprites have an anchor point that is at 75% of y. So instead of being dead center, it is centered on the X - and 3/4s up on the Y.
So when you try to line the sprite up with the body/shape - it is offset.
With the Chipmunk code I was using, allowed me to offset the body/shape so that it lined up perfectly - and I could then move it and rotate it no worries.
Have I missed a way of setting the point of origin or anchor point somewhere?
Do I have to roll some maths code to calculate the offset (taking into account the rotation) - not sure if I still have enough skills!
Any ideas.
Thanks
Justin