More problems with mouse [SOLVED]

Started by LupaShiva, Mon 24/01/2011 11:24:23

Previous topic - Next topic

LupaShiva

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.

Khris

#1
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:
Code: ags
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.

LupaShiva

And how i change it manually? in Characters i know how to do it theres animation speed. Thank you for the help mate.

Khris

Just open the view, click on one of the frames, then change the delay value in the properties pane.

LupaShiva

Ohhh, i didnt know this, damn i feel so dumb sorry khris and thank you a lot  ;)

SMF spam blocked by CleanTalk