xxxxxxxxxx
31
let element;
let input;
function setup() {
createCanvas(400, 400);
element= createP("Hi");
element.mousePressed(changeBackground);
element.mouseOver(drawThing)
// element.style('color','red')
// element.style('background-color','green')
input= createInput('miralo')
}
function addInputToCanvas(){
text (input.value(), random (width), random(height))
}
function drawThing(){
line (random(height), random (width),random(height), random (width))
}
function draw() {
// background(220);
input.changed(addInputToCanvas)
}
function changeBackground(){
background (random(255));
}