add optional end function call to tweens

This commit is contained in:
2024-08-23 14:17:51 -05:00
parent b589a742cf
commit 27fa286625
2 changed files with 2 additions and 2 deletions

View File

@@ -103,7 +103,7 @@ Ease.elastic = {
Ease.elastic.c4 = 2*Math.PI/3;
Ease.elastic.c5 = 2*Math.PI / 4.5;
var tween = function(from, to, time, fn)
var tween = function(from, to, time, fn, endfn)
{
var start = profile.secs(profile.now());
var update = function(dt) {
@@ -114,6 +114,7 @@ var tween = function(from, to, time, fn)
fn(to);
if (stop.then) stop.then();
stop();
endfn?.();
}
profile.endframe();
};