Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Minimi on Fri 30/04/2004 15:28:06

Title: Mouse over hotspot/object information popup GUI... need help!
Post by: Minimi on Fri 30/04/2004 15:28:06
Ok, I just have no idea how to call it, what I want to accieve, so please don't mind the LONG subject.

I'm trying to make a GUI that when I'm with the mousepointer on an object/hotspot, that besides the pointer the name of that hotspot/object appears.

Could anyone point me to an already excisting tutorial on this, or explain to me how to accieve this? Untill now I really haven't got much grip on the GUI, and would like to learn it better!

Thanks in advance!
Title: Re:Mouse over hotspot/object information popup GUI... need help!
Post by: strazer on Fri 30/04/2004 15:36:38
- Create a GUI
- Set GUI's background and foreground color to 0
- Uncheck the GUI's "Clickable" checkbox
- Create a label on the GUI
- Put in repeatedly_execute(_always):
SetGUIPosition(NUMBERORNAMEOFHOTSPOTGUIHERE, mouse.x, mouse.y);

Then either

- Set the label's text to @OVERHOTSPOT@

or put in rep_ex:

string hotspotdescription;
GetLocationName(mouse.x, mouse.y, hotspotdescription);
SetLabelText(NUMBERORNAMEOFHOTSPOTGUIHERE, 0, hotspotdescription); // 0=object number of text label

IMO, the easiest way is @OVERHOTSPOT@ but I think I've read somewhere that this shouldn't be used anymore?
Title: Re:Mouse over hotspot/object information popup GUI... need help!
Post by: Minimi on Fri 30/04/2004 16:23:00
Thank you very much strazer! Just one question, for I haven't tested it yet. Does this immediatley also work for objects, or only hotspots?
Title: Re:Mouse over hotspot/object information popup GUI... need help!
Post by: strazer on Fri 30/04/2004 17:56:09
You're welcome. :)

It works for hotspots, objects & characters as long as they have a description/name.