Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: sloppy on Sat 28/01/2006 21:09:52

Title: GUI Status Bar
Post by: sloppy on Sat 28/01/2006 21:09:52
I'm sure this has been asked but I can't locate where.Ã,  I have a status bar that names all the hotspots.Ã,  That was easy.(@OVERHOTSPOT@)

How do you do the same thing with objects and player characters?
Title: Re: Gui Status Bar
Post by: petazzo on Sat 28/01/2006 22:13:04
If I have understood well, you want a gui that displays characters and objects names?
@HOVERHOTSPOT@ should display them as well. For the objects make sure you've gived them a name.
Title: Re: Gui Status Bar
Post by: monkey0506 on Sat 28/01/2006 22:20:35
The name is kind of misleading, but I think it would only be troublesome changing it now.
Title: Re: Gui Status Bar
Post by: sloppy on Sat 28/01/2006 23:42:33
You're right it does work.  I hadn't named the objects and I didn't have my player character checked as clickable.
Title: Re: Gui Status Bar
Post by: sloppy on Sun 29/01/2006 16:21:45
New question regarding this:  I would like the status bar label to also show the name of the button in the gui when the mouse is hovered over it (walk, look, save game, etc.).  How is that scripted?
Title: Re: Gui Status Bar
Post by: Ashen on Sun 29/01/2006 16:41:18
That can't be done directly AFAIK, you'll have to do it in script using repeatedly_execute (rep_ex_always if the GUI is modal), e.g.:

  if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnIconAbout) lblStat.SetText("About");
  else if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnIconQuit) lblStat.SetText ("Quit Game");
  else if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnIconSave) lblStat.SetText("Save Game");
  // Etc for all buttons
  else lblStat.SetText("@OVERHOTSPOT@");

(Making sure o use the right Label and Button names for your game.)
Title: Re: Gui Status Bar
Post by: sloppy on Sun 29/01/2006 17:45:43
Yes, that worked.  Thanks!