How do I pause on unfocus in NW.js?

Get help using Construct 2

Post » Sun Dec 06, 2015 11:23 pm

MalizaGames wrote:I get what you mean now. But honestly why can't you just pause the game.. I mean if we're talking about a game here then why can't you just hit esc then that pauses the game. When you come back into the game and hit resume it just resumes. I don't see why that can't just be a work around?


I wasn't able to open your example because you saved it on the newest beta (I'm on the r216 still), but I understand what you're saying. I have sort of a specific use case that I'm not expecting Scirra to support, but I was really just hoping there would be a solution I could use already available.

My game will be playable on a large touchscreen table in my local public library. Users can open games from the Windows 8 Metro screen, at which point they go full screen. If a user presses the Windows button and returns to the Metro menu to pick another game, the library does not want my game to continue to produce sound while running in the background. So, the ideal solution in my use case would be an auto-suspend, as I can't expect the users (mostly small children) to press a pause button before abandoning my game.

Now that I'm thinking about it, I wonder if exporting the game as a proper Windows 8 app might behave differently. I hadn't thought about it until this point because I wasn't planning on putting the game in the Windows Store, but it might be worth testing out.
B
14
S
2
Posts: 73
Reputation: 794

Post » Sun Dec 06, 2015 11:28 pm

Oh okay so you're issue is basically you're running multiply games inside on app? Can't you just set when they go back to the menu or press the button it stops music and speed for that layout?
B
8
S
1
Posts: 34
Reputation: 599

Post » Sun Dec 06, 2015 11:29 pm

Sorry if I don't make sense @doneyspaceman I don't dev on windows I do android and web.
B
8
S
1
Posts: 34
Reputation: 599

Post » Mon Dec 07, 2015 12:10 am

MalizaGames wrote:Oh okay so you're issue is basically you're running multiply games inside on app? Can't you just set when they go back to the menu or press the button it stops music and speed for that layout?


No, the other apps would be other games, so the issue is with navigating the OS and not something I can handle inside Construct 2.

MalizaGames wrote:Sorry if I don't make sense @doneyspaceman I don't dev on windows I do android and web.


It's fine, I appreciate your suggestions either way. :D
B
14
S
2
Posts: 73
Reputation: 794

Post » Fri Mar 04, 2016 9:26 pm

Have you found a solution yet?

I have the same issue (though, me it's for a PC game, not tablet)
B
10
S
3
G
1
Posts: 25
Reputation: 803

Post » Fri Mar 11, 2016 5:31 pm

Phenom wrote:Have you found a solution yet?

I have the same issue (though, me it's for a PC game, not tablet)


My workaround was exporting to the Windows 10 app store (which I needed to do for other reasons, the fact that the game would pause on unfocus was just a nice bonus). Sorry if that's not helpful. :)
B
14
S
2
Posts: 73
Reputation: 794

Previous

Return to How do I....?

Who is online

Users browsing this forum: ST314, yolkgames and 28 guests