max.message("pudate",x,y) > How can i get cursor absolute screen position?
Hi,
I'm making a dial in jsui. i hide the cursor onclick and and show it on button release.
After dragging, I would like to positionate the cursor back on the dial location. For that, i can use max.message("pupdate",x,y).
My problem is that "pupdate" message only accept xy absolute positions on the screen. If i have relative coords of something in a JSUI box, how can i translate them in absolute screen positions ?
I have tried:
"patcher.wind.location" (to give me the window location)
+ box l or t (to give me offset of the jsui in the patcher itself)
+ my coords relatives to jsui box
1 - It doesn't work
2 - even if it had worked, it seems that "patcher.wind.location" is not updated when moving the window.
I think i can do the trick with mousestate but i would like to do it all in the js script.
Many thanks
Bump? The following code used to work but not anymore.
max.pupdate(patcher.wind.location[0]+box.rect[0]+5,patcher.wind.location[1]+box.rect[1]+5)