• Register a callback in the engine update event
    This is called every frame

    Parameters

    • cb: LifecycleMethod

      The callback to be called

    • Optionalopts: LifecycleMethodOptions

    Returns () => void

    A function that can be called to unregister the callback

    onUpdate((ctx : Context) => {
    // do something
    console.log("Needle Engine: onUpdate registered")
    // optional to cleanup:
    return () => { console.log("onUpdate removed") }
    }