Hi
I am trying to move and rotate a layer but I am having a problem. I can change the position of the layer but if I change the anchor point, rotate the layer and then tell it to move up it doesn't. Instead it moves at an angle.
If I don't change the anchor point the layer moves up normally but subsequent rotations happen at the anchor point which is off screen. I want the rotation to happen at a certain point on screen. Why changing the anchor point changes the direction the layer moves?
Thanks for any help.
Layer and anchor problem
(6 posts) (3 voices)-
Posted 2 years ago #
-
"Why changing the anchor point changes the direction the layer moves" bc its frame of reference has changed. Its still moving "up" to it.
Suggestion: Create a 1st CocosNode, put your 2nd CocosNode inside the first. Move the 1st when you want to offset, rotate the 2nd when you want to rotate. Will that work?
Posted 2 years ago # -
I will try that and see what happens. Thanks!
Posted 2 years ago # -
The node I use for rotation ignores the anchor point change. Although the anchor point changed, the rotation takes place at the initial position.
Posted 2 years ago # -
The anchor point changes correctly on the first layer. Its child (CocosNode) ignores the new anchor point. Is this a bug?
Posted 2 years ago # -
I think the bug is still in the latest version (0.99.5).
Some body fixed that?Posted 11 months ago #
Reply
You must log in to post.