I am currently trying to use the mouse component as both a response and to move a circle object around an arc based on the mouse position on screen. See image below:
The word and circle I want to move about the black arc.
I know I need to use the mouse.getPos() x and y variables (I’ve tried using mouse.getPos()[0] and mouse.getPos()[1] for x and y) and then put them into equations to convert the x and y values into an angle and then convert that angle into x and y coordinates on the arc. See code below:
angle = Math.atan2(mouse.getPos()[1] - centerY, mouse.getPos()[0] - centerX);
arcx = centerX + radiusitem * Math.cos(angle);
arcy = centerY + radiusitem * Math.sin(angle);
However, when I run this code as a component, the x and y positions are not updated by the mouse and even when I use just the mouse.getPos()[0]/[1] as the circles position to update (i.e. just have the circle freely follow the mouse) I receive a syntax error for: log=false.
Any help or suggestions?