Manually animating the mouse cursor (SOLVED)

Started by Creator, Fri 30/10/2009 22:39:38

Previous topic - Next topic

Creator

How could I get the mouse to complete an animation when the mouse button is pressed? Something like Character.Animate. I've tried:

Code: ags

if (mouse.IsButtonDown(eMouseLeft)) {
  int mouse_view = 5;
  mouse.ChangeModeView(mouse.Mode, mouse_view);
  }
else mouse.ChangeModeView(mouse.Mode, -1);


But that only made the mouse go spazzy when held down and stopped on a random frame when the button was released. I however need the mouse to complete a full animation loop. How could I do it?

TerranRich

I would use the on_mouse_click event. Then, when the left button is pressed, change the cursor's View property to an animation view where the cursor is animated.

This may cause the animation to repeatedly loop, however. Do you want it to repeat, or just complete one and only one loop?
Status: Trying to come up with some ideas...

Creator

I only want it to play the animation loop once per click. Also I don't really understand what you mean by changing it to a view where the cursor's animated. Could you expand on that?

TerranRich

Cursors can have a View setting. So if you add in an animation loop in a view in the AGS editor, which shows the cursor animating, you can set the Cursor to that view.
Status: Trying to come up with some ideas...

Creator

OK I've tried that and it works OK. Only problem is it sometimes loops before I change the view back to a still image, but the solution I've found is to change the delay on the frames in the view so it's slower. So it now all works well. Thanks for your help.

SMF spam blocked by CleanTalk