Animate Mouse on click only

Started by Bad Voo-doo man, Thu 14/07/2005 10:45:04

Previous topic - Next topic

Bad Voo-doo man

I know how to animate the mouse cursor when its over a hotspot/object, or moving..but I can't figure out how to get it to animate only when clicked..It's probably something simple, but I can't find it in the help files
<img>Image Comming Soon!</img>
The Fall of Reach (A Halo fan game)
STORY: 100%
GRAPHICS: 2%
CODE: .56%

Gilbert

Put the animate codes in the on_mouse_click() function of the global script.

Bad Voo-doo man

I figured that much ;) I just can't figure out the code, theres nothing I can find thats like the code for animating everything else
<img>Image Comming Soon!</img>
The Fall of Reach (A Halo fan game)
STORY: 100%
GRAPHICS: 2%
CODE: .56%

monkey0506

Well if you wanted to allow it to animate if you clicked on a GUI then you could try something like:

Code: ags
/* rep_ex */
if (mouse.IsButtonDown(eMouseLeft) || mouse.IsButtonDown(eMouseRight)) {
  int mouse_view = -1;
  if (mouse.Mode == eModeWalkto) mouse_view = WALKCURVIEW;
  else if (mouse.Mode == eModeLookAt) mouse_view = LOOKCURVIEW;
  /* etc. */
  mouse.ChangeModeView(mouse.Mode, mouse_view);
  }
else mouse.ChangeModeView(mouse.Mode, -1);


That way any time you click the mouse (either button) the cursor would animate with the proper view.  However you would have to manually assign the value of mouse_view.  Or you could just do something like this in the "if (...IsButtonDown...) {" block:

Code: ags
if (mouse.Mode == eModeWalkto) mouse.ChangeModeView(mouse.Mode, WALKCURVIEW);
else if (mouse.Mode == eModeLookAt) mouse.ChangeModeView(mouse.Mode, LOOKCURVIEW);
/* etc. */


But that requires several more calls to mouse.ChangeModeView...I hope this helps.

Bad Voo-doo man

Hey, thanks. I'll go give it a try and get back to ya
<img>Image Comming Soon!</img>
The Fall of Reach (A Halo fan game)
STORY: 100%
GRAPHICS: 2%
CODE: .56%

SMF spam blocked by CleanTalk