P5js-Dom-Textarea

From Digipool-Wiki
Revision as of 19:44, 22 February 2021 by WikiSysop (Talk | contribs)

Jump to: navigation, search

myInput = createElement('textarea', 'your text here');

myString = myInput.value();


Example

var myString;
var myInput;

function setup() {
  myInput = createElement('textarea', 'your text here');
  myInput.position(100, 100);
  myInput.size(200,200);
  createCanvas(400, 400);
}

function draw() {
  background(220);
  
  myString = myInput.value();
  text(myString, 20, 20);
}