Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Ghostlady on Sun 10/07/2005 20:55:50

Title: Quit or Play Gui
Post by: Ghostlady on Sun 10/07/2005 20:55:50
I am creating a Quit or Play gui.Ã,  All the documentation I am looking at is for 2.62 or below and refers to the "interface_click".Ã,  The "interface_click" is now obsolete in version 2.7.Ã,  Can someone show me an example of where to scrip the "play" and "quit" buttons from the gui?
Title: Re: Quit or Play Gui
Post by: Ashen on Sun 10/07/2005 22:14:45
Once you've given the buttons script names (e.g. btnQuit and btnPlay), you should just be able to double click them in the GUI editor window to create the relevant functions and open the editor at the right place.

Every GUI control (buttons, text boxes, etc) gets its own function, something like:

#sectionstart btnQuit_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnQuit_Click(GUIControl *control, MouseButton button) {
  QuitGame(0);
}
#sectionend btnQuit_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart btnPlay_Click  // DO NOT EDIT OR REMOVE THIS LINE
function btnPlay_Click(GUIControl *control, MouseButton button) {
  gQuitplay.Visible = false;
}
#sectionend btnPlay_Click  // DO NOT EDIT OR REMOVE THIS LINE
Title: Re: Quit or Play Gui
Post by: Ghostlady on Mon 11/07/2005 02:12:39
That worked nice.Ã,  ;) ;D