Posted: Fri Nov 08, 2019 5:11 pm Post subject: How to develop a mouse motion tracking?
Hello.
I have two pictures of mouse movements.
And they're sensitive to possible mouse movements, they need to move.
I set 3 trajectories with simple codes.
With 5mm shifts that are sensitive to mouse movements.
The code works fine, but I need to make some improvements.
For example: How do I provide one-to-one motion instead of 3 trajectories?
So: How do I move one by one, one by one instead of a 5mm shift?
1mm + 1mm + 1mm + 1mm + 1mm = 5mm ..
function TopMove(sender)
local x,y = getMousePos()
x,y = UDF1.CEImage1.ScreenToClient(x,y)
if y > 135 then
UDF1.CEImage2.Top = 139
UDF1.CEImage3.Top = 139
elseif y > 125 then
UDF1.CEImage2.Top = 136
UDF1.CEImage3.Top = 136
elseif y > 110 then
UDF1.CEImage2.Top = 134
UDF1.CEImage3.Top = 134
end
end
function LeftMove(sender)
local x,y = getMousePos()
x,y = UDF1.CEImage1.ScreenToClient(x,y)
if x > 160 then
UDF1.CEImage2.Left = 186
UDF1.CEImage3.Left = 219
elseif x > 115 then
UDF1.CEImage2.Left = 187
UDF1.CEImage3.Left = 211
elseif x > 100 then
UDF1.CEImage2.Left = 180
UDF1.CEImage3.Left = 213
end
end
The explanation may be weak, I apologize for it.
Thanks in advance for rare ideas.
EDIT :
"For the little witch, it was a nice pastime.
The cat's eye movements amuse him. "
Why not use a timer and move it by pixel by pixel (or some sort of logic) until boundaries box/radius are reached?
Sorry for the late response.
If I'm not mistaken: for each picture, I have to create a main point.
And if the Mouse moves away from or from the main point, the Left and Top will change proportionally.
I'il try.
Still, I would appreciate it if you crowned your idea with a sample code.
Thanks for the answer. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum