tween callback

This commit is contained in:
2025-01-12 11:56:10 -06:00
parent 4524bd4f84
commit 5feacca44c
3 changed files with 4 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ globalThis.sim = {};
sim.mode = "play";
sim.play = function () {
this.mode = "play";
os.reindex_static();
// os.reindex_static();
game.all_objects(o => {
if (!o._started) {
o._started = true;

View File

@@ -1249,7 +1249,7 @@ var imgui_fn = function imgui_fn() {
// imgui.endframe(render._main);
};
//if (dmon) dmon.watch('.');
if (dmon) dmon.watch('.');
function dmon_cb(e)
{

View File

@@ -112,7 +112,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, cb) {
var start = profile.now()
var update = function tween_update(dt) {
@@ -121,6 +121,7 @@ var tween = function (from, to, time, fn) {
if (elapsed >= time) {
fn(to);
stop();
cb?.();
}
};
var stop = Register.update.register(update);