xxxxxxxxxx
29
let button;
let intext;
let label = " ";
function setup() {
createCanvas(windowWidth,windowHeight);
intext = createInput("Write your text here")
button = createButton("Submit");
intext.position(10,10);
button.position(10,40);
button.mousePressed(addText);
textSize(48)
}
function draw() {
background(220);
text(label , 10, 200 );
// what does this do?
// text(intext.value() , 200, 20 );
}
function addText(){
// Un-comment one of the lines to see!
// label = label + intext.value()
label = label +"\n"+ intext.value()
}