I wanted to make a label move in a circle but couldn't figure out the algorithm. Studied up on some basic trigonometry and wrote this nice function that can be used to place the x,y coordinates of a circle based on the center point and radius.
rad is the radius of the circle.
(optional) angle is the degree to which the coordinates will be grabbed. If attached to the movement of a label, this will determine the distance around the circle the label will travel.
the cirCoors table will hold your x and y coordinates in two separate tables.
Here's an example of it in use. It's being used to move the yellow orb in a circle. The video's a bit choppy and its much smoother in actuality.
Here's the script I used to move the yellow orb. It is attached to a UI timer and enabled after drawCircle() is ran:
Share your scripts and packages with other Mudlet users.
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest