Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Tue 28/09/2004 16:24:24

Title: Room Name on GUI
Post by: on Tue 28/09/2004 16:24:24
I have  afull screen menu GUI and I want it to have text in the corner that changed regarding what room your in.

example...

You're in the Cell.
You're in the Hallway.

Is this possible?

If so I would like to know how it can be done.

Thanks in advance.
Title: Re: Room Name on GUI
Post by: Ashen on Tue 28/09/2004 17:49:39
The simplest way is probably to use SetLabelText(); in every room's Player enters screen (before fade in), to set the text on the GUI.
e.g.

  // script for room1: Player enters screen (before fadein)
SetLabelText (GUI, 0, "You're in the Hallway."); // or whatever the GUI and object numbers are


  // script for room2: Player enters screen (before fadein)
SetLabelText (GUI, 0, "You're in the Cell."); // or whatever the GUI and object numbers are



Alternatively, you could create a Name property for the rooms (See 'Custom Properties' in the manual if you don't know how), and use something like this in the global rep_ex:

string room;
string label;
GetRoomPropertyText ("Room Name", room); // or whatever you called the property
StrFormat (label, "You are in the %s", room);
SetLabelText (GUI, 0, label); // or whatever the GUI and object numbers are
Title: Re: Room Name on GUI
Post by: on Tue 28/09/2004 17:57:49
Thanks Ahsen.
Thanks alos for the GUI help before it worked.  ;)

And yay I actually signed up.