describing GUI

Started by Gepard, Sun 11/02/2007 10:16:37

Previous topic - Next topic

Gepard

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.
Drink up me 'arties! Yo ho!

Akatosh

#1
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:

Code: ags

  // 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; 


Gepard

#2
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!
Drink up me 'arties! Yo ho!

Akatosh


SMF spam blocked by CleanTalk