Page 1 of 1

Detect screen mouse position

PostPosted: Tue Jan 05, 2016 12:59 pm
by rodimus111
I want to move the windows when mouse button is down anywhere in the canvas. I got x & y cordinates with Touch.AbsoluteX+NWjs.WindowX but, when the window is too large, flickering appears. Is there another way to get x & y screen coordinates?

Re: Detect screen mouse position

PostPosted: Wed Jan 06, 2016 8:14 am
by Lof
Not sure it will work but what about setting touch x.y to a var when start touching, then while touching calculate the position by distance from the start point to the current touch (inside the canvas)?

Re: Detect screen mouse position

PostPosted: Wed Jan 06, 2016 11:32 am
by rodimus111
No. The problem seems to be that there is a retard when the algorithm is trying to detect the window position. The result is an erroneous movement when the window is dragged. I think that getting the X and Y coordinates with javascript or something, could give better ressults.