Mouse over hotspot/object information popup GUI... need help!

Started by Minimi, Fri 30/04/2004 15:28:06

Previous topic - Next topic

Minimi

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!

strazer

- 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?

Minimi

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?

strazer

You're welcome. :)

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

SMF spam blocked by CleanTalk