I am trying to find a value using the location of the mouse cursors click, using pixel coordinates. The problem is that I have a function, def on_mouse(event, x, y).
There are other things here inside the function, but the crux of the problem is that I don’t have any way to retrieve the x and y values from inside of the function, which gives me x and y values depending on where I clicked.
So when outside of the function I do x + y, it says x and y are undefined.
I’ve tried everything I can think of, returning x, returning y, but I think I’m being dumb, to be honest. Im sure there’s a simple solution and I’m just being silly.
use the args to enter parameters for the event: