[JavaScript]canvas.clip
animate() { requestAnimationFrame(()=>{ this.animate(); }); const ctx; ctx = canvas.getContext('2d'); ctx.globalCompositeOperation = "source-over"; ctx.globalAlpha = 1.0; ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.save(); ctx.beginPath(); ctx.rect(0,0,canvas.width,100); ctx.clip(); //ここに描画処理 ctx.restore(); }