loop(
opts) ->handle
Create a fixed-timestep frame loop
opts:
fps (default 30); update (fn(dt, t) — called at the fixed step, possibly multiple times per frame to catch up; render (fn(canvas)); input (fn(key, mods, event, shifted, base)); on_resize (fn(cols, rows)); canvas (the canvas passed to render and displayed); display (true to auto-create an absolute top-left display over the canvas, a display object to reuse, or nil for none); alt_screen (default true — enter the alt screen + raw mode + KKBP, restored on stop); setup/teardown (fn(handle)); max_frame (dt clamp, default 0.25).Handle:
:run() (own lev.run, blocks until stopped), :start() (spawn into a running lev.run, returns immediately), :stop(), :pause(), :resume(), :is_running(); handle.canvas, handle.display, handle.fps_actual.