Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / On desktop, how do you detect closing the window?

Author
Message
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 16th Apr 2016 12:17
Hi folks,

on desktop with a window, instead of showing fulllscreen... is there a way to detect if someone pressed the X button or is closing it via the system menu.
I would like to show a dialog "Do you want to exit the game?"

Cheers
Michael
-----------------------------------------------------------
Using AGK2 Tier 1
[a http://www.fantomgl.com]fantomEngine[/a] - A powerful 2D game framework
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Apr 2016 17:16
Can't with tier 1, possible with tier 2 c++.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Apr 2016 18:13
means its a feature request for tier1.
AGK (Steam) V2.0.18 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 16th Apr 2016 18:31
Man, that is bad. Such a basic feature.
-----------------------------------------------------------
Using AGK2 Tier 1
[a http://www.fantomgl.com]fantomEngine[/a] - A powerful 2D game framework
Haxx0r
8
Years of Service
User Offline
Joined: 18th Apr 2016
Location:
Posted: 18th Apr 2016 02:13
Well to be honest I'm not sure it is a great idea to detect if someone is trying to close the window. The only apps that do that are ones where closing without saving could make you loose critical data. What happens if say the graphics device is lost (might happen if the user reinstalls the graphics drivers while the app is running)? Then your window will be completely blank and they can't close your app normally because they can't see the confirm close dialog. Yes, I know loosing the graphics device is pretty hard on OpenGL platforms but it is possible on certain graphics cards.
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 18th Apr 2016 16:32
Would be great to have this for tier 1. Applications with save functions would benefit from this.
Regards Sph!nx
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 18th Apr 2016 19:21
Nice to have when making an editor for a game.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 18th Apr 2016 22:19
This is not impossible if you run your app through a wrapper window. You can run the AppGameKit executable nested in a panel (for example) and make the panel stretch to fit the form, then use standard events / messageboxes to detect and interrupt the exit event and check that the user actually wants to exit the app. Then if they do simply make sure the AppGameKit process is also closed. It would be better as a tier 1 command of course...
Using AppGameKit V2 Tier 1
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th Apr 2016 22:59
i know its possible to hide the window title & buttons in other languages, so agk can do this too with a little effort.
if so you can set your own close button with your own behavior.
AGK (Steam) V2.0.18 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-09-29 13:26:49
Your offset time is: 2024-09-29 13:26:49