Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gepard on Sun 11/02/2007 10:16:37

Title: describing GUI
Post by: Gepard on Sun 11/02/2007 10:16:37
Hi ther. I want to have two guis - inventory and describing gui, so after I click on some item in my inventory, the other GUI will show a text for this item. How do I do this?

Thanks.
Title: Re: describing GUI
Post by: Akatosh on Sun 11/02/2007 10:58:32
I'd advise you not to do it at all and use the Display("text"); command instead, but if you really need a description GUI like this...

Creating the GUI

1.) Create a new GUI  := and name it DESCRIPT or something like that. Adjust the GUI's size to what seems fitting, e.g. 150x100

2.) Set "Visible" to "Popup modal"

3.) Create a new label on that GUI, name it e.g. DESCRIPTLABEL, set the x and y positions to 2 and the width and height to the respective GUI values.

4.) Create a new button, name it e.g. "Closebutton" and give it the following code:
gDescript.Visible=false;

5.) Put gDESCRIPT.Centre(); in the game_start event

Using the GUI

The code you'll have to use looks like this:


  // script for Inventory item 1 (Key): Look at inventory item
descriptlabel.Text="This is a key.[It's a yellow key.[[That's pretty much everything you can say about it.";
gDescript.Visible=true;

Title: Re: describing GUI
Post by: Gepard on Sun 11/02/2007 11:18:41
Oh! Thats really difficult  :D. Thanks for the help. I will try it and see how it works :)

EDIT:
It works! And its great! : ) I managed to open and close this descriptive gui along with inventory window. Thanks for help!
Title: Re: describing GUI
Post by: Akatosh on Sun 11/02/2007 13:20:09
You're welcome  :)