Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Hoffenlarft on Sun 27/02/2005 16:48:03

Title: Help with GUI
Post by: Hoffenlarft on Sun 27/02/2005 16:48:03
Hi. I have this problem: I've made a GUI and created a label in it, and now I want that every time the mouse ir over a hotspot, a character or an object, the name of these appears in the label. I know the @OVERHOTSPOT@, but what can I do with the characters and objects?






P.S.:Sorry for the mistakes, my english it's not the best.
Title: Re: Help with GUI
Post by: strazer on Sun 27/02/2005 16:59:21
Although the name doesn't imply it, @OVERHOTSPOT@ works with objects and characters as well.
Title: Re: Help with GUI
Post by: Sektor 13 on Sun 27/02/2005 17:06:07
i wonder, what about if you have cursor over a GUI button..

example: I have a "walkie talkie" GUI, there are 3 pictures of persong you can call them if you click on them, but when is mouse cursor over the mouse buttons, i would like that the name is showen before you click on it...
Title: Re: Help with GUI
Post by: Scorpiorus on Sat 05/03/2005 18:30:40
Then you have to script it. It would look something like this:

repeatedly_execute:

if (GetGUIAt(mouse.x, mouse.y) == GUI_NAME_HERE)
{
   int button = GetGUIObjectAt(mouse.x, mouse.y);

   string name;
   StrCopy(name, "");

   if (button == 1) StrCopy(name, "PERSON1");
   if (button == 2) StrCopy(name, "PERSON2");
   if (button == 3) StrCopy(name, "PERSON3");

   SetLabelText(GUI, LABEL, name);

}