// hideShow // James Brink, 6/23/2020 let can, can2, hide, show, showInline; let c; function setup() { c = createCanvas(200, 200); resizeCanvas(100, 160); can = createCanvasClass(200, 200); can.resizeCanvas(100, 160); can2 = createCanvasClass(200, 200); can2.background("cyan"); can2.rect(20, 40, 15, 25); can2.line(0,0, 100, 200); hide = createButton("hide"); hide.mousePressed(hideIt); show = createButton("show"); show.mousePressed(showIt); showInline = createButton("showInline"); showInline.mousePressed(showInlineIt); } // setup function draw() { background("orange"); ellipse(40, 50, 10, 10); can.background("gold"); can.ellipse(40, 50, 10, 10); can.text("This is the CanvasClass that will be hidden and shown.", 10, 80, 68); } // draw function hideIt() { can.hide(); } function showIt() { can.show(); } function showInlineIt() { can.show(true); }