Hello ladies and gents! I have a question, but first I'll explain what results I'm after:
I want a button to loop through a series of graphics as long as the mouse is hovered over it.
My current bit of code looks like this:
function animatemenu()
{
btnMenu.NormalGraphic = 15;
Wait(7);
btnMenu.NormalGraphic = 13;
Wait(7);
btnMenu.NormalGraphic = 11;
Wait(7);
}
}
function repeatedly_execute()
{
//Animate Menu Button
GUIControl*button=GUIControl.GetAtScreenXY(mouse.x,mouse.y);
if (button==btnMenu) {
animatemenu();}
}
So - this is functioning, it's looping the graphics exactly as I want. Couple problems with it, though:
It's causing the mouse cursor to vanish when hovering. It appears again very very briefly when the cycle completes. This is causing the mouse cursor to flicker in time with the cycles, with isn't very aesthetic, but isn't a huge problem...
... the main issue is that the mouse also can't click the button. Clicking doesn't do anything (worth noting that I've checked that, without this function, clicking works just fine).
I've tried adding a mouse.IsButtonDown(eMouseLeft) as a condition but that didn't work. I'm probably going about this in an inefficient manner - is there a better way of getting this result without making the mouse disappear/unable to click?
Thanks folks!