Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Creator on Fri 30/10/2009 22:39:38

Title: Manually animating the mouse cursor (SOLVED)
Post by: Creator on Fri 30/10/2009 22:39:38
How could I get the mouse to complete an animation when the mouse button is pressed? Something like Character.Animate. I've tried:


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?
Title: Re: Manually animating the mouse cursor
Post by: TerranRich on Sat 31/10/2009 03:00:52
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?
Title: Re: Manually animating the mouse cursor
Post by: Creator on Sun 01/11/2009 08:52:07
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?
Title: Re: Manually animating the mouse cursor
Post by: TerranRich on Tue 03/11/2009 01:18:46
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.
Title: Re: Manually animating the mouse cursor
Post by: Creator on Tue 03/11/2009 12:10:04
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.