Add command: Rotate.set.centerpoint

Hi

There seem to exist several rotate object commands. It would be great to have a command (or expand a existing) where we could set the center point of the rotate movement (e.g. the center of the circle on which the object orbits). That way it would be easy to create all sorts of orbit designs.

Example: I have a big rock rotating slowly in the middle of the screen. Now I want a little object (fuel cell) sitting always on the same spot somewhere on the rock. If I do this with a sinus/cosinus function, it takes a long adjusting time to keep it on the same spot. A orbiting function with a setting for the rotating speed and x,y center point would give a perfect sync with the rock.

What do you think?

Regards

Olivier

obj.anchorX = 0

obj.anchorY = 0

obj:rotate(90)

Will spin the object around the top left corner of the box.  .anchorX and .anchorY are values from 0 to 1 where 0.5 is the center of the box. 

Rob

Thx, Rob. I did not write clearly: The anchor point shall be a free point on the stage, allowing orbits like a planet around the sun.

This is only inside the box of the object, isn’t it?

Olivier

If you’re looking for orbital rotation logic, I posted some snippets to my github a while back:

https://github.com/pancinteractive/axisrotation

Thanks for your code. I know how to do it with sinus/cosinus, but a command would be very helpful to sync rotating and orbiting objects. Olivier

obj.anchorX = 0

obj.anchorY = 0

obj:rotate(90)

Will spin the object around the top left corner of the box.  .anchorX and .anchorY are values from 0 to 1 where 0.5 is the center of the box. 

Rob

Thx, Rob. I did not write clearly: The anchor point shall be a free point on the stage, allowing orbits like a planet around the sun.

This is only inside the box of the object, isn’t it?

Olivier

If you’re looking for orbital rotation logic, I posted some snippets to my github a while back:

https://github.com/pancinteractive/axisrotation

Thanks for your code. I know how to do it with sinus/cosinus, but a command would be very helpful to sync rotating and orbiting objects. Olivier