Mouseover Button Effect

Started by KodiakBehr, Sat 14/07/2012 03:47:21

Previous topic - Next topic

KodiakBehr

I want to set my GUI up so that when the cursor mouse-overs any button in the GUI, it switches to a pointing cursor, and when it moves off that button, it goes back to what it was.

So I figured the best was to go about it is to add in rep_exec :

GUIControl*gc = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if (gc == btnIconInv) mouse.UseModeGraphic(eModePointer);
else mouse.UseDefaultGraphic();

Problem is, now it's constantly calling the current cursor, resulting in the stuttering of the cursor animation.  Is there a better way to accomplish my objective?

ThreeOhFour

Have you tried adding a condition to your else?

Something like:

Code: ags

GUIControl*gc = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
if (gc == btnIconInv) mouse.UseModeGraphic(eModePointer);
else if (gc != btnIconInv && mouse.GetModeGraphic(eModeInteract) != 2389) mouse.UseDefaultGraphic();

KodiakBehr


ThreeOhFour


SMF spam blocked by CleanTalk