Wait during first animation

Started by NickyNyce, Wed 22/06/2011 16:17:03

Previous topic - Next topic

NickyNyce

I'm sure this has been asked, I feel bad about having to post, but I can't seem to find the exact problem, ... forgive me

I entered this in after fade in
 
 oTank.SetView(20, 0, 0);
 oTank.Animate(0, 10);
 oTank.Animate(0, 10, eRepeat, eNoBlock, eForwards);


I have an object animating... everything works except for the "wait" during the first initial animation of the view. Afterwards it runs fine, I'm assuming the second line is blocking, I'm wondering how to animate this object so I don't have to wait     

appreciate the help

monkey0506

From the manual, for Object.Animate:

QuoteFor blocking you can pass either eBlock (in which case the function will wait for the animation to finish before returning), or eNoBlock (in which case the animation will start to play, but your script will continue). The default is eBlock.

So your second line of code is blocking, your third line isn't.

Just to be clear, what you're doing is running through the animation in the object's view, loop 0, delay 10 blocking once, and then repeatedly running the same animation non-blocking after that.

If that's not what you're trying to do, then you might need to explain a bit more, but I imagine all you want is this:

Code: ags
  oTank.SetView(20, 0, 0);
  oTank.Animate(0, 10, eRepeat, eNoBlock);


That does the same thing as your posted code with the exception that the animation never blocks.

NickyNyce

Really sorry monkey, what's even worse is I thought I tried it, think I've been at this too long. RTFL....RTFL....RTFL.... got it


Thanks for the help

monkey0506

Well the thing to keep in mind is just because the examplr in the manual calls the Animate function twice it doesnt mean you have to. Besides, if you look, that example is using two totally separate objects.

Glad you got it fixed though. ;)

SMF spam blocked by CleanTalk