I'm having trouble scripting a button to animate while the mouse is over it. I'm sure it's not difficult and i'm just stupid.
There's unfortunately no elegant way to do this:
// in repeatedly_execute(_always)
GUIControl*gc = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if (gc == Button1) {
if (!button1_animating) {
Button1.Animate(BUTTONVIEW1, 0, 3, eRepeat);
button1_animating = true;
}
}
else {
Button1.NormalGraphic = 47;
button1_animating = false;
}
If you have more than one or two buttons that are supposed to be animated, it's probably better to use a more general approach.