# Simplistic MyCanvas Example

    let canvas1, canvas2, backgroundColor1;
    function setup() {
      canvas1 = createCanvasClass(180, 170);
      canvas1.parent("Example");
      canvas1.fill(255, 0, 0);
      canvas1.mouseClicked(clicked);
      backgroundColor1 = "FloralWhite";
      canvas2 = createCanvasClass(150, 200);
      canvas2.parent("Example");
      canvas2.stroke(255, 0, 255);
    }
    function draw() {
      canvas1.background(backgroundColor1);
      canvas1.rect(canvas1.mouseX, canvas1.mouseY, 150 ,80);
      canvas2.background("Khaki");
      canvas2.line(canvas2.mouseX, canvas2.mouseY, 130, 120);
    }
    function clicked() {
      if (backgroundColor1 == "FloralWhite") {
        backgroundColor1 = "LightCyan";
      } else {
        backgroundColor1 = "FloralWhite";
      }
    }

Drag your mouse though the canvases.

James Brink 6/6/2020