Windows focus

For questions about using Classic.

Post » Wed Jan 11, 2012 8:13 pm

Is there a way to check if the game window has focus?
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Thu May 03, 2012 4:10 am

I want to know this too, my game needs to pause when the window doesn't have focus.
Anyone?
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Wed May 09, 2012 2:45 am

I tried to put an event on the F10 key but it loses focus before the event is played. Does anyone know if Construct can even detect if the game loses focus or if there is a way to keep it from pausing?
B
13
S
4
G
1
Posts: 63
Reputation: 1,170

Post » Wed May 09, 2012 3:50 pm

I ended up just forcing my game to the front unless it was paused =/

Also, I had to set the exit to control to something crazy like ctrl + y so people wouldn't accidentally exit while typing.Jayjay2012-05-09 15:50:45
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Wed May 09, 2012 5:25 pm

How did you force the game to the front?
B
13
S
4
G
1
Posts: 63
Reputation: 1,170

Post » Wed May 09, 2012 6:06 pm

Gelidaer, with Window object set Always on top: On.
I think that's what jayjay did.

Window object really needs an option to indentify focus, maybe on the next CC version?
Please lucid help us! =X
Metal_X2012-05-09 18:08:06
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Wed May 09, 2012 8:26 pm

You can check if the game window has focus with python.
http://dl.dropbox.com/u/5426011/examples11/focus.zip
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Wed May 09, 2012 8:40 pm

Thanks R0J0hound! But how can i return this value to the events system?

Edit: Nevermind i did it this way:
-System - Phyton Compare
>"Window.Caption" == "has focus"

Edit2: I put it in my game and it din't work, i put the py paste in the directory too, but nothing. Any ideia what i did wrong?

Edit3: LOL "enable phyton" was disable on my application...

Thank you so much R0J0hound!
Metal_X2012-05-09 22:03:29
B
22
S
7
G
5
Posts: 90
Reputation: 3,430


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests