loop()
ts
function loop(fn, options?): Loop;Defined in: loop.js:35
Runs fn every animation frame.
time is the seconds the loop has been running, not counting time spent stopped, so animations resume where they left off. delta is the seconds since the previous frame.
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | (time, delta, frame) => void | Called with the seconds the loop has run, the seconds since the last frame, and the frame number. |
options? | LoopOptions | See LoopOptions. |
Returns
Example
ts
loop((time, delta) => {
quad.bindVAOs();
quad.setUniforms({ u_time: time });
quad.render();
});