Actuate get current time

I’m not sure how to get current tween time.
I would like to have something like:

Actuate.tween (MySprite, 60, { alpha: 1 }).onUpdate (showTime);
function showTime():Void
    //get time from tween:59,58,57......

not sure if Actuate has a function for that, but you coudl do something like that:

private var _tweenStartTime:Float = 0; 
_tweenStartTime = haxe.Timer.stamp();
Actuate.tween (MySprite, 60, { alpha: 1 }).onUpdate (showTime);
function showTime():Void {
var timePassed = haxe.Timer.stamp() - _tweenStartTime;

I ran into this same problem – onUpdate should arguably give you the tween progress (from 0 to 1) so you can use it for something custom.

I’ve been thinking of rewriting Actuate to avoid Dynamics, this would be a good change to make, too


I’m trying to solve issue with Actuate tweening:

Actuate.tween(mask, 60, { scaleX: 0 } ));

But if you look animation it doesn’t look good. I would like to timer (green stripe) scaleX to 0 at exactly 60 seconds. It mean at 30 secon should be scaled to a half.

Try: Actuate.tween (mask, 60, { scaleX: 0 }).ease (Linear.easeNone);

The import is motion.actuate.easing.Linear

work like a charm! :+1: