【p5.js】radius.gif

<script src="https://unpkg.com/p5.createloop@0.2.8/dist/p5.createloop.js"></script>
function setup() {
  createCanvas(400, 400);
  createLoop({gif: {render: false, download: true, fileName: 'radius.gif'}});
}

function draw() {
  background(220);
  const radius = 200 * sin(millis()/200);
  circle(width/2, height/2, radius);
}

参考

GitHub - mrchantey/p5.createLoop: Create animation loops with noise and GIF exports in one line of code.
Create animation loops with noise and GIF exports in one line of code. - mrchantey/p5.createLoop
タイトルとURLをコピーしました