Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: karja on Sat 23/04/2011 22:18:52

Title: Mouse over gui - show Gui name in description(@OVERHOTSPOT@)?(SOLVED)
Post by: karja on Sat 23/04/2011 22:18:52
In Death episode 2, that I am working on, I have a box like graphic GUI that you need to click to open the inventory.
The problem is that i use overhotspot descrition to show what the mouse hovers over, but on GUIs it doesnt show anything.

So basically the question is:
Is it possible to get the GUIs name in the description GUIs overhotspot label?
Title: Re: Mouse over gui - show Gui name in description(@OVERHOTSPOT@)?
Post by: Khris on Sat 23/04/2011 22:24:20
Something like this should work:

 String d = "@OVERHOTSPOT@";

 GUI*g = GUI.GetAtScreenXY(mouse.x, mouse.y);
 if (g == gInventory) d = "inventory";

 lblDescription.Text = d;


Just a general way to do it; I guess in an actual game you'd use GUIControl.GetAtScreenXY and set the description to "load game" for the load button, etc.
Title: Re: Mouse over gui - show Gui name in description(@OVERHOTSPOT@)?
Post by: karja on Sat 23/04/2011 22:32:01
Wow that was fast.

Thanks it worked like a charm :)