Quit game

Started by fiaschetta, Wed 23/11/2005 22:10:13

Previous topic - Next topic

fiaschetta

How i modify the window of quit game?

Ashen

You can't directly, you'll need to make a custom GUI.
I know what you're thinking ... Don't think that.

fiaschetta

I want change the color and the bottom of Quit game....

strazer

You can't directly, you'll need to make a custom GUI.

Pumaman


sloppy

That Quit GUI tutorial is good except that it shows GUI scripting using an old version of AGS.  When you finish your buttons and text, where do you script it?  If you click on the "edit script" button, it says -   // This function is obsolete, from 2.62 and earlier versions.

I assume the scripting goes in the Global scripting, but where exactly?  Is there an updated  tutorial showing how to do this using version 2.7?

petazzo

To make the script for the buttons go to the button you have created, give it a name and choose "Left Click - Run script". Then double click on the button you want to make the script for it. The global script window should appear; write in the quit button section "QuitGame(0);". In the play button section write something like "gGuiname.Visible = false;" where Guiname is the name of the gui.
I never forget a face, but in your case I'll be glad to make an exception.
(Groucho Marx)

sloppy

Okay, I've got you so far. 

But how do you script it so that my "QUIT/PLAY" GUI appears when you click the EXIT button, and not the old GUI?

Ashen

Quote from: The Quit GUI Tutorial
6. Add script to turn the new GUI on

This is all well and good, but we still haven't actually enabled our GUI to be turned on during the game. If you've still got the Script Editor window open, you'll notice a line (line 13 in the screenshot above) which checks for the user clicking the Quit button in the icon bar, and exits the game.

We need to change this to call up our GUI instead - so replace the "QuitGame(1);" line with a command to bring up our GUI:
GUIOn(QUITGUI);

Between that and what petazzo's told you, you should be able to figure it out:
On the GUI's tab go to the ICONBAR GUI (the one the 'Exit' button's on).
Click the 'Exit' button to edit it's script.
Change QuitGame(1); to gGuiname.Visible = true; where gGuiname is the script name of your Quit GUI.

On a general note, take a read through the GUI commands section of the manual, to get an idea what the new commands are - the entries also tell you what old-style commands they've replaced, while looking up the old commands will take you to the new.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk