, Sr. Member
So, I may be on my own on this one, but hopefully someone can chime in and tell me if I’m way off.
In SmoothSkeletonAnimator.as, I’ve added a single function.
public function seek(percentage:Number = .5):void {
if (_lerpNode) {
var timeToSeek:Number = _lerpNode.duration * percentage;
warpTime(timeToSeek);
}
}
Ok, what this is attempting to do, is get the duration of the current animation and multiply it times the seek number. So if the duration is 3000ms, it will return 1500.
So then I created a new public function in AnimatorBase.as.
protected function warpTime(timeOffset:Number):void {
_time = int(getTimer()-timeOffset);
}
This is supposed to offset the _time property so that it thinks it’s halfway through the animation and if I keep calling this function, it should appear to freeze on the half way point. Only it’s not working. Instead it seems to be trying to catch up for time lost (as if it’s correcting for a loss in frame rate). This makes sense, except I don’t know where this is being handled. Any ideas? I feel like a seek/scrub function would be extremely useful.