GUI mouse-overs?? (was Simple int to string theory)

Started by , Tue 12/05/2009 19:46:20

Previous topic - Next topic

m0ds

I have a simple script question because I cannot access the game files where I've used this code before.

I have a slider called "count" and I have a label called "displaycount" that I want to display the number the slider is currently at, ie 1 to 100. I think it has something to do with calling StrFormat but I really don't understand what the help guide is telling me.

Can someone please post me the code?

Many thanks :)

Khris

displaycount.Text = String.Format("%d", count.Value);

m0ds

Well, that was stupidly easy - thanks Khris!

I'm sure this post'll be updated with fresh questions pretty soon :)

Khris


m0ds

Cool! Well I have another question, hopefully simple!

I have 2 GUIs. GUI 1 has a label text in it which changes over various hotspots, simple. GUI 2 has a button in it that when I move the mouse over it I want the label text in GUI 1 to display it.

However there doesn't seem to be a simple "is mouse over button" command, can it be replicated somehow? Obviously it's not about changing the mouseover graphic, but simply some way of AGS recognising my mouse being over the button.

Any help appreciated :)

Khris

Something like this should do the trick:

Code: ags
// inside repeatedly_execute

  GUIControl*gc = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
  if (gc == button_name_here) label.Text = "button";
  else label.Text = "@OVERHOTSPOT@";


SMF spam blocked by CleanTalk