Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: rickious on Mon 30/09/2013 13:54:13

Title: How do I link a save icon from GUI: gPanel? [SOLVED]
Post by: rickious on Mon 30/09/2013 13:54:13
I had to remove the save icon from the gPanel because i balled something up in the code somewhere somehow.  So I want to add a 'save' and 'load' icon, how do I link these to the save and load GUIs?

Thanks in advance.  I can get on with other things now.
Title: Re: How do I link a save icon from GUI: gPanel?
Post by: TGames on Mon 30/09/2013 14:58:46
first you would set up the buttons on the gPanel, then you would go to the actions menu,and hit on click. you would then code:
gPanel.Visible=false;
insert svae or load gui name
g               .Visible=true;
I hope this helps
Title: Re: How do I link a save icon from GUI: gPanel?
Post by: Khris on Mon 30/09/2013 16:31:37
This works for a custom save/load GUI.

To show the built-in ones, just call RestoreGameDialog() / SaveGameDialog().
Title: Re: How do I link a save icon from GUI: gPanel?
Post by: rickious on Mon 30/09/2013 20:28:50
when you say 'call', how do i do that?  :-[
Title: Re: How do I link a save icon from GUI: gPanel?
Post by: Crimson Wizard on Mon 30/09/2013 20:31:46
Quote from: rickious on Mon 30/09/2013 20:28:50
when you say 'call', how do i do that?  :-[

"Call" = "Call function" (programming/scripting term) = write function name with parameter list between opening and closing brackets.
Examples:
Code (ags) Select

RestoreGameDialog(); // no parameters expected, hence nothing between brackets
SaveGameDialog();
float x = Math.Cos(1); // "calling" cosin function

Title: Re: How do I link a save icon from GUI: gPanel?
Post by: Khris on Mon 30/09/2013 20:38:25
Also, in case that's unclear: create the button's OnClick function and link it to the event by double clicking the button in the GUI editor. Then just write the command inside the function.
Title: Re: How do I link a save icon from GUI: gPanel?
Post by: rickious on Mon 30/09/2013 20:39:35
Cheers people, you learn something new every few hours with AGS (laugh)