justinmind-logo
 
Upvote 1

cursorX in simulation mode gives client coordinates

Solved Victor Conesa 8 years ago

I am trying to build some drag and drop functionality in my prototype, but I have found that the variable cursorX in simulation mode gives the client window coordinates of the simulation window, rather than relative to the screen size of the prototype I am building (like any other coordinates, widths, lengths, etc. in the prototype).


There is an obvious solution which is to make the simulation window smaller so that its client window matches exactly the prototype width, but I cannot rely on my colleagues and clients to be doing that all the time.


Anybody can suggest a better fix? Thanks!

Replies (1)
photo
1

Ok, I found the solution myself:


The variable Window Width also gives results in terms of the client window of the simulation application. So, using the expression:


Cursor X - round ( ( Window Width - 1024 ) / 2, 0 )


gives the actual coordinates of the cursor relative to my prototype window (which is 1024 pixels wide).


Annoying, but problem solved!

Leave a Comment
 
Attach a file