How do we drag a window with Node webkit? (SOLVED)

Get help using Construct 2

Post » Sat Sep 28, 2013 7:13 am

I am trying to move a frameless window around when the user clicks on my custom title-bar.

All i can find to do this trick is this from the node-webkit manual.:

https://github.com/rogerwang/node-webkit/wiki/Frameless-Window



Does C2 have anything for mouse-dragging the window? All I can see is how to set the X and Y of the window.

TIA for any help :)
jojoe2013-09-28 19:54:52
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Sat Sep 28, 2013 7:52 pm

Ok, thanks to an ancient thread from back in 2007 Ashley gave me the answer I was looking for:
http://69.24.73.172/scirra/forum/viewtopic.php?t=3198&p=24570

You want to make so that when the user clicks on the titlebar it sets a variable (like MoveWindow)to 1. And on left mouse button up, set it back to 0... That way the cursor can even leave the window area, and disengage the move function when the user releases the button.. This even works across multiple monitors :)

Here is a cheat-sheet for anyone interested:
https://docs.google.com/file/d/0B7p8-X5UMeryTDVkTU10dXdUUFk/edit?usp=docslist_api



B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, senecaa and 18 guests