Room Name on GUI

Started by , Tue 28/09/2004 16:24:24

Previous topic - Next topic

Plog

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.

Ashen

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.
Code: ags

  // 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:
Code: ags

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
I know what you're thinking ... Don't think that.

Plog

Thanks Ahsen.
Thanks alos for the GUI help before it worked.  ;)

And yay I actually signed up.

SMF spam blocked by CleanTalk