How do I save on exit?

Get help using Construct 2

Post » Mon Jul 27, 2015 4:27 pm

I'm making an idle game. A typical feature of these games is that you can close them at any time and progress will be saved. How do I get this behavior? "on end of layout" event is not when the window is closed, making this an unsuitable trigger.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Mon Jul 27, 2015 6:34 pm

The browser object has onSuspended and onResumed.
B
59
S
21
G
9
Posts: 641
Reputation: 9,787

Post » Mon Jul 27, 2015 8:44 pm

OnSuspend is for when the user alt-tabs. It might be called when they close, but it will also be called very frequently.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Mon Jul 27, 2015 9:31 pm

Mylon wrote:OnSuspend is for when the user alt-tabs. It might be called when they close, but it will also be called very frequently.

If you are referring to closing an application through a button you can use the Browser "Close" action. And just say the progress before it. But if you are talking about closing the application using the "X" in the top right corner, then such feature is not available unfortunately.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Mon Jul 27, 2015 9:45 pm

Is "On Browser Close" a feature added betwee 206 and 210? I don't see it on 206.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Mon Jul 27, 2015 10:24 pm

Its the browser object and an action called "Close" its not an event. I think it have been there since the browser object have been there, but yeah definitely further back than 206. There are no events that triggers on a close action as far as I know.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 11 guests