eukleides/animate.js

11 lines
322 B
JavaScript
Raw Permalink Normal View History

2025-02-09 20:33:33 +00:00
const drawing = editor.drawing;
const duration = 10;
const fps = 5;
const frames = [];
for(let frame = 0; frame < duration*fps; frame++) {
const t = frame/fps;
drawing.ctx.get_time = () => t;
drawing.ctx.draw();
frames.push(drawing.html);
}
console.log(frames.join('\n\n<<FRAME SEPARATOR>>\n\n'))