My problem is that the origin of the canvas is at the top left and the test of the if statement only works if the origin of the canvas is at the middle.
Is there a way to change the origin point of a canvas ?
If not, maybe there is a way to change the equation of the if statement ?
diskRadius (in pixels, you chose 247 but it might be a proportion (half?) of min(Canvas1.Height,Canvas1.Width) if you switch Screen1 to responsive)
centerDiskX (in pixels, the x value of the center of the big disk)
centerDiskY (in pixels, the y value of the center of the big disk)
The equation for being in the circle then becomes
if sqrt((currentX - global centerDiskX)^2 + (currentY - global centerDiskY)^2)) < global diskRadius
If this runs slow, you can speed it up by squaring both sides of the inequality to get the equivalent but faster check:
if (currentX - global centerDiskX)^2 + (currentY - global centerDiskY)^2 < global diskRadiusSquared
where diskRadiusSquared is initialized as the square of the big disk radius, a constant.