Animating Objects

Started by , Mon 09/02/2004 05:28:25

Previous topic - Next topic

Walknuki

So.... how can I, if I can at all, animate objects?

strazer

It's in the help file:

AnimateObject (int object, int loop, int delay, int repeat)

Starts the object number OBJECT animating, using loop number LOOP of its current view. The overall speed of the animation is set with DELAY, where 0 is the fastest, and increasing numbers mean slower. The delay for each frame is worked out as DELAY + FRAME SPD, so the individual frame speeds are relative to this overall speed.
The REPEAT parameter sets whether the animation will continuously repeat the cycling through the frames. If REPEAT is zero, the animation will start from the first frame of LOOP, and go through each frame in turn until the last frame, where it will stop. If REPEAT is 1, when the last frame is reached, it will go back to the first frame and start over again with the animation. If REPEAT is 2, it will do the animation once, but then return the graphic to the first frame and stop (whereas repeat=0 will leave the graphic on the last frame).

Example:

AnimateObject(0,2,0,0);

will animate object 0 using loop 2 of its current view once.

Walknuki

Okay, but how do I set an object to a view? All I see how to do is set it to a single sprite.

Then again, it is almost 4am, and the answer is probably right in front of my face.

Hell, I almost just posted a question asking why my dialog wasn't working, and I forgot to include any Return lines in it.  :P

strazer

QuoteOkay, but how do I set an object to a view?

Never done it myself (yet ;) ), but I suppose this is it:

SetObjectView
SetObjectView (int object, int view)

Sets object number OBJECT's view to VIEW. The graphic is set to the first frame of loop 0 of the view.
Example:

SetObjectView(3,14);

will change object’s 3 view to view number 14.

SMF spam blocked by CleanTalk