# Need help on how to rotate overlays!

hi, so I’ve been struggling so much on how the rotating overlays work. I’ve looked at dara amaries guide and i still don’t understand. Can someone please explain to me! thank you

First of all, for every rotation you’ll have a line like this:

@overlay OVERLAY_NAME rotates D anchor point X Y in T

These four variables (D, T, X, and Y) stand for these numbers:

D: the degree of rotation

• between -360 and 360
• positive numbers go clockwise and negative numbers go counter-clockwise

T: time for rotation

X: the horizontal axis of rotation for the overlay

• between 0 and 1
• 0 creates the anchor point on the far left and 1 creates the anchor point on the far right

Y: the vertical axis of rotation for the overlay

• between 0 and 1
• 0 creates the anchor point on the bottom and 1 creates the anchor point on the top

Most likely, your anchor will be in the center (0.5 0.5), but it can very. Sometimes you’ll just have to experiment to find out what you want. I hope this helps. Feel free to ask any questions for clarification.

1 Like

This diagram may help as well.

hi bigest problem is usually to understand the anchor point

you need to keep in mind that you have to always first change the anchor point and only after that shift the overlay.

Explanation:

Anchor point is point on overlay - it defines the centre of the rotation and it also defines the point to which relate the shift coordinates.

And that is the reason why of you shift it in right position and then change anchor point the overlay will be in different place.

The shift is still the same but different “dot” on the overlay relates to it.

Also what is necessary to understand is that script reads every overlay as rectangle (which you see in the preview around the overlay) and it “counts in” also the empty space around the overlay.

Therefore if you have overlay of a ball and all the empty space is cut the centre of the ball will be in the centre of the rectangle. But if you will have lets say on the left side of the ball lot of transparent space included in the overlay and the ball will not be in the centre of the rectangle it will be very hadr to find the centre of the ball.

Maybe write what exactly you struggle with - it will be more easy to explain it.

Also here I do explain the anchor point too:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.