Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Kal-El on Mon 24/10/2005 14:02:35

Title: SOLVED - Custom Quit GUI
Post by: Kal-El on Mon 24/10/2005 14:02:35
Hi, I've read the Custom Quit GUI section here (http://www.adventuregamestudio.co.uk/actutgui1.htm) but this was written before the latest version of AGS so a lot of the functions are invalid or have been omitted.

I've designed the actual interface and new buttons - no problem here.

The problem is how do I code the YES NO buttons? i.e. when it says 'are you sure you want to quit? YES NO' how do I make it quit if you click on the YES button and how do I make it resume the game when I click on the NO button?
Title: Re: Custom Quit GUI
Post by: Ubel on Mon 24/10/2005 14:24:24
if (button == 0) { //The Quit button
Ã,  QuitGame(0);
}

if (button == 1) { //The Return-to-game button
Ã,  gQuit.Visible = false; //Here gQuit is your quit GUI.
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //So if your GUI's script name is for example "EXIT" then you change this to gExit.Visible = false;
}


I hope this helps.
Title: Re: Custom Quit GUI
Post by: Kal-El on Mon 24/10/2005 14:28:17
That's good thanks.

But how do I call the new quit GUI after the user clicks on QUIT in the status bar? The Quit GUI is called QUITGUI (gQuitgui).

Thanks in advance!
Title: Re: Custom Quit GUI
Post by: Ubel on Mon 24/10/2005 14:34:46
You just simply use the Visible code again:

gQuitgui.Visible = true;

If this is what you meant.
Title: Re: Custom Quit GUI
Post by: Ashen on Mon 24/10/2005 14:37:11
This is really all in the manual - if you're just coming back to AGS, try reading through it to re-familiarise yourself.
Although, I admit some of the tutorials link on the site could use updating.
Title: Re: Custom Quit GUI
Post by: Kal-El on Mon 24/10/2005 14:38:33
Bloody hell, of course! lol

Thanks Pablo!

Quote from: Ashen on Mon 24/10/2005 14:37:11
This is really all in the manual - if you're just coming back to AGS, try reading through it to re-familiarise yourself.

I did read through it but it doesn't really go in-depth enough to cover what I needed to do. The online guides were my best option but they too were out of date.

Anyhow, problem solved now!
Title: Re: SOLVED - Custom Quit GUI
Post by: Ubel on Mon 24/10/2005 14:47:32
Quote from: Kal-El on Mon 24/10/2005 14:40:05
I did read through it but it doesn't really go in-depth enough to cover what I needed to do.

Quote
Visible property (GUI)

Example:

gSettings.Visible = true;

will turn on the SETTINGS GUI.

That was the example from the manual and I think that was all you needed to know. :)
Title: Re: SOLVED - Custom Quit GUI
Post by: Ashen on Mon 24/10/2005 14:48:12
Visible Property (GUI) (http://www.adventuregamestudio.co.uk/manual/GUI.Visible.htm)

QuitGame (http://www.adventuregamestudio.co.uk/manual/QuitGame.htm)

Seems fairly detailed to me.

Beaten to the punch, but what the heck.

Looking  at the tutorial you linked, the only major change is GUI.Visible replacing GUIOn/Off(). Oh, and the individual GUI control functions replacing the global interface_click (which is probably the more confusing, it's true).
Title: Re: SOLVED - Custom Quit GUI
Post by: Kal-El on Mon 24/10/2005 14:52:55
Yes but it didn't go too in-depth for me. It meant nothing to me infact. This is my first time at designing my own custom GUI so I found it quite difficult.

That's why I resorted to the online 'detailed' guide.