Feature Request: Pause on unfocus apart from preview.

Discussion and feedback on Construct 2

Post » Sat Mar 05, 2016 7:13 pm

I'm wondering why the project setting "Pause on unfocus" is specified as only available during preview? I'd like to have that feature as part of my exported NW.JS app.

Maybe there's another way of achieving the same thing? Any way to do that by editing the code itself? I think I found the relevant part in the preview.js script but I have no idea how to get it into my exported game's data.
FREEDOM: Diegesis - Out Now for Windows! http://freedom.quicksandgames.com
B
22
S
5
G
1
Posts: 83
Reputation: 1,818

Post » Sat Mar 05, 2016 11:27 pm

There was a discussion about this before and (if I remember correctly) there's a browser limitation that prevents the HTML5 apps from doing that kind of stuff. Someone correct me if I'm wrong.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717

Post » Sun Mar 06, 2016 12:39 am

I worked on the problem today and I got the feature working by simply changing the part of the code that disables it when not in preview mode (in preview.js). But I'm still left wondering if there's a good reason why it was disabled in the first place. Can't be that it doesn't work, glerikud, since it does now (for NW.JS at least).
FREEDOM: Diegesis - Out Now for Windows! http://freedom.quicksandgames.com
B
22
S
5
G
1
Posts: 83
Reputation: 1,818

Post » Sun Mar 06, 2016 8:53 am

Thanks for the heads up, now I know it's possible. Hopefully someone will clear it up why it's not included.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717

Post » Tue Mar 08, 2016 12:08 am

@Ashley could you explain why the feature was restricted? I'll be releasing my game soon and I don't want to keep that in if it causes known issues.
FREEDOM: Diegesis - Out Now for Windows! http://freedom.quicksandgames.com
B
22
S
5
G
1
Posts: 83
Reputation: 1,818

Post » Tue Mar 08, 2016 1:10 pm

It's designed to stop the game running while you go back to edit it further in Construct 2. Why would you want that after publishing?
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,746

Post » Tue Mar 08, 2016 1:57 pm

Ashley wrote:It's designed to stop the game running while you go back to edit it further in Construct 2. Why would you want that after publishing?

While I'm fine without this feature, I can see situations when it becomes useful. For ex. the player plays the game and someone just texted her on Facebook and she wants to reply. In this case the player won't have to find an implemented pause feature (if there's any).
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717

Post » Tue Mar 08, 2016 6:00 pm

Ashley wrote:It's designed to stop the game running while you go back to edit it further in Construct 2. Why would you want that after publishing?


Because people tend to multi-task on computers and so its nice to have the game automatically pause events and especially sound when one clicks on a different window.

Thanks for the info.
FREEDOM: Diegesis - Out Now for Windows! http://freedom.quicksandgames.com
B
22
S
5
G
1
Posts: 83
Reputation: 1,818

Post » Tue Mar 08, 2016 9:20 pm

Quicksand wrote:
Ashley wrote:It's designed to stop the game running while you go back to edit it further in Construct 2. Why would you want that after publishing?


Because people tend to multi-task on computers and so its nice to have the game automatically pause events and especially sound when one clicks on a different window.

Thanks for the info.

What about timescaling?
Check if the game is out of focus, when it is just set it to 0.
The browser plugin has all the conditions you need for that. :)
ImageImageImage
B
60
S
22
G
78
Posts: 646
Reputation: 44,730

Post » Wed Mar 09, 2016 4:44 am

TheRealDannyyy wrote:
Quicksand wrote:
Ashley wrote:It's designed to stop the game running while you go back to edit it further in Construct 2. Why would you want that after publishing?


Because people tend to multi-task on computers and so its nice to have the game automatically pause events and especially sound when one clicks on a different window.

Thanks for the info.

What about timescaling?
Check if the game is out of focus, when it is just set it to 0.
The browser plugin has all the conditions you need for that. :)


I tried that but it doesn't seem to work when NW.JS is used as the ersatz browser. Unless I just had it set up wrong.

Anyway modifying the runtime code myself worked, its just not the most convenient way of going about this.
FREEDOM: Diegesis - Out Now for Windows! http://freedom.quicksandgames.com
B
22
S
5
G
1
Posts: 83
Reputation: 1,818

Next

Return to Construct 2 General

Who is online

Users browsing this forum: jobel and 3 guests