"hyperlink" variable strings in mw?

Posted by Sgbarter on Sun 31 Aug 2008 02:22 AM — 2 posts, 11,859 views.

#0
Thanks to some help from people here I have made a miniwindow that grabs quest information. It's very similar to the one Nick made (for Aardwolf) but it cuts up the display and does it like this:

Quest Mob: smelly mutt
Room name: The dawg house
Area name: Pet Store

My next idea was to do hotspots for certain words, for example if I click on the name of the area it could try to run to that area, or use a portal. Or click on the mob's name to hunt to the mob. My understanding of hotspots is that it can only be given to a fixed position, and since the area name (or other variables) will change I can't figure out how to do this?
Australia Forum Administrator #1
It certainly can be done, I am working on something that makes hyperlinks on text in arbitrary positions.

Basically, when you do WindowText you must know the x and y position of the text.

The WindowText function returns the length, so you now know the finishing x position (by adding to the start x position).

Then WindowFontInfo (fontid, 1) returns the height, so you know the depth - add that to the y position to get the ending y position. Put that all together and you have the rectangle for the hotspot.