tween callback
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user