Finer control over 2D Animations
by Derrick Simpson · in Torque X 2D · 02/03/2007 (3:10 pm) · 2 replies
Is it possible to have control over an animation sequence that has been created by the TGBX editor from C# ?
Basically, I want to only use one animation sequence for my character. I want to have it either playing when he's moving, (faster, if he's moving faster, slower if he's moving slower), or have it stopped at the standing frame.
Assuming that is possible. When my character does stop, I would like the frames play backwards until my character is in his stand still sequence (maybe frame 1), rather than having him him just snapping back to the stand position.
If this isn't in the engine, I think it would definitely increase the cool factor of the sprite animation engine in Torque X.
Thanks!
- Derrick
Basically, I want to only use one animation sequence for my character. I want to have it either playing when he's moving, (faster, if he's moving faster, slower if he's moving slower), or have it stopped at the standing frame.
Assuming that is possible. When my character does stop, I would like the frames play backwards until my character is in his stand still sequence (maybe frame 1), rather than having him him just snapping back to the stand position.
If this isn't in the engine, I think it would definitely increase the cool factor of the sprite animation engine in Torque X.
Thanks!
- Derrick
About the author
Recent Threads
#2
Also, I noticed there is a PauseAnimation() method, but it's private.
Thanks for replying!
- Derrick
02/04/2007 (5:40 pm)
Yeah, I found that yesterday. Sorry that I didn't update the post. That also pauses the animation, to start it again, you have to call PlayAnimation() .Also, I noticed there is a PauseAnimation() method, but it's private.
Thanks for replying!
- Derrick
Joshua Butterworth
(_player as T2DAnimatedSprite).SetAnimationFrame(*frameNumber*);
So you'd just need something in your control component to check if the player was not moving and decrement the framenumber backwards to a certain point.