if mouse is pressed, create and reactangle code example
Example 1: p5 js if mouse pressed
if (mouseIsPressed)
Example 2: if mousepressed javascript
var mouseDown = 0;
document.body.onmousedown = function() {
++mouseDown;
}
document.body.onmouseup = function() {
--mouseDown;
}