Game Development Community

Pause a t2dAnimatedSprite

by Pronto Games Engineer1 · in Torque Game Builder · 06/12/2008 (3:35 pm) · 1 replies

Is there a way to pause and resume the animation of a t2dAnimatedSprite? Something like the PauseAnimation property in TorqueX? Thanks.

#1
06/15/2008 (7:12 pm)
You can hack it pretty well:

//hacked solution to freeze an animation
function afterImageObject::onFrameChange(%this, %frameIndex)
{
   %this.setAnimationFrame(%frameIndex - 1);  
}

Note that the onFrameChange callback must be enabled:

%object.setFrameChangeCallback(true);