p5.js:quad()
code:sketch.js
const sketch = p => {
p.setup = () => {
//キャンバスを作成
const canvas = p.createCanvas(600,425);
canvas.id = '__P5sc__';
//背景色
p.background('#eee');
p.stroke('#aaa');
}
p.draw = () => {
if (p.mouseIsPressed) {
p.fill(0,0,0,10);
} else {
p.fill('#fff');
}
p.quad(p.mouseX, p.mouseY, p.mouseX+10, p.mouseY+80,p.mouseX+70, p.mouseY+80,p.mouseX+100, p.mouseY+30,);
}
}
new p5(sketch, 'editor');
p5-sketch-button.icon(実行ボタン)
https://img.shields.io/badge/p5.js-quad()-ED225D.svg?logo=p5.js&style=for-the-badge