GUI Status Bar

Started by sloppy, Sat 28/01/2006 21:09:52

Previous topic - Next topic

sloppy

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?

petazzo

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.
I never forget a face, but in your case I'll be glad to make an exception.
(Groucho Marx)

monkey0506

The name is kind of misleading, but I think it would only be troublesome changing it now.

sloppy

You're right it does work.  I hadn't named the objects and I didn't have my player character checked as clickable.

sloppy

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?

Ashen

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.:
Code: ags

  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.)
I know what you're thinking ... Don't think that.

sloppy

Yes, that worked.  Thanks!

SMF spam blocked by CleanTalk