xxxxxxxxxx
19
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
canvas.width = canvas.height = 200;
ctx.fillStyle = 'steelblue';
ctx.fillRect(0, 0, 200, 200);
ctx.fillStyle = 'plum';
ctx.fillRect(10, 10, 150, 100);
let canvasRef;
function setup() {
createCanvas(400, 400);
canvasRef = select('#canvas')
}
function draw() {
background(220);
image(canvasRef, mouseX, mouseY)
}