So I’ve been working it out and here’s what I’ve gotten:
[lua]img.Think = function()
local frx, fry = frame:GetPos()
local x,y = gui.MousePos()
x = x - frx
y = y - fry
if math.abs(x - lastx) + math.abs(y - lasty) > 5 and ( x - frame:GetWide()/2 ) ^ 2 + ( y - (frame:GetTall() - img:GetTall()/2 - 25) ) ^ 2 <= ( ( 175 / 2) / 2 ) ^ 2 then
lastx,lasty = x,y
It may seem like a lot of fancy math, but that’s irrelevant. The point is, it detects movement well enough to make sure that it works.
However, my question is how do you detect whether the movement is clockwise or counterclockwise? It wouldn’t be enough to consider whether x + y is positive or negative, because it can be either and go either clockwise or counterclockwise.
I understand this is a difficult question (for me at least), and I would greatly appreciate any help I can get.
For the few of you going “wtf is this”,