How do I detect when game windows is being moved?

Get help using Construct 2

Post » Fri Aug 11, 2017 3:55 am

I simply want to know, how to tell if someone is moving, the game window. Pretty simple...
B
21
S
3
Posts: 53
Reputation: 1,100

Post » Sat Aug 12, 2017 8:48 am

You mean like the browser tab ?
'Image'Image'Image
B
20
S
6
G
2
Posts: 99
Reputation: 2,503

Post » Sat Aug 12, 2017 7:16 pm

I think it's only doable with nwjs. If you add the nw.js object you can access the x,y position of the window.

Then to check if it changed you could do

global number winx=0
global number winy=0

start of layout
--- set winx to nwjs.windowx
--- set winy to nwjs.windowy

winx != nwjs.windowx
or
winy != nwjs.windowy
--- set text to "user moved window"
B
94
S
33
G
114
Posts: 5,357
Reputation: 73,775

Post » Sun Aug 13, 2017 3:45 pm

@R0J0hound That is the general idea of what I want to achieve. But; In my project, the position of the window is already being set every tick. Do you know of anyway, that I could detect the window moving now?
B
21
S
3
Posts: 53
Reputation: 1,100

Post » Sun Aug 13, 2017 3:46 pm

@Donald Cela No
Last edited by angryscientist on Mon Aug 14, 2017 1:00 am, edited 1 time in total.
B
21
S
3
Posts: 53
Reputation: 1,100

Post » Sun Aug 13, 2017 11:05 pm

Just update winx and winy when you move the window with events and it will still be able to tell when a user moves it.
B
94
S
33
G
114
Posts: 5,357
Reputation: 73,775

Post » Mon Aug 14, 2017 1:07 am

@R0J0hound I am trying your proposed solution. But I am confused by what you mean by "!", when you said "winx != nwjs.windowx". Is that an expression? Or what?
B
21
S
3
Posts: 53
Reputation: 1,100

Post » Mon Aug 14, 2017 2:01 am

It's "not equal to."
B
94
S
33
G
114
Posts: 5,357
Reputation: 73,775


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 24 guests