Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: LupaShiva on Mon 24/01/2011 11:24:23

Title: More problems with mouse [SOLVED]
Post by: LupaShiva on Mon 24/01/2011 11:24:23
How do i set the delay for a View on a mouse cursor whens over something? i searched in the manual AnimationSpeed property, and the properties of view but can't do it.
Title: Re: More problem with mouse
Post by: Khris on Mon 24/01/2011 19:31:04
You have to change the delay values for the frames of (the first loop of) the view. I guess the default delay value is 5, so to change that to 8, enter 3 as the frame delay for every frame. You can also enter -3 to change it to 2, if you need the animation to be faster.


EDIT:
Disregard the rest of this post, ViewFrame.Speed is read-only. You have to change the delay settings manually.



Here's a function:
void ChangeLoopDelay(int view, int loop, int delay) {
 ViewFrame*vf;
 int frames = Game.GetFrameCountForLoop(view, loop);
 int i;
 while (i < frames) {
   vf = Game.GetViewFrame(view, loop, i);
   vf.Speed = delay;
   i++;
 }
}


Now you can use e.g.
  ChangeLoopDelay(MOUSE_INTERACT, 0, -3);
Btw, the same general method works for IdleViews.
Title: Re: More problem with mouse
Post by: LupaShiva on Mon 24/01/2011 20:35:44
And how i change it manually? in Characters i know how to do it theres animation speed. Thank you for the help mate.
Title: Re: More problem with mouse
Post by: Khris on Mon 24/01/2011 21:01:36
Just open the view, click on one of the frames, then change the delay value in the properties pane.
Title: Re: More problem with mouse
Post by: LupaShiva on Mon 24/01/2011 21:46:48
Ohhh, i didnt know this, damn i feel so dumb sorry khris and thank you a lot  ;)