createButton

Static createButton 

Source
pub static createButton: CreateButtonInternalType
Expand description

Creates a button element in the DOM. Use .size() to set the display size of the button. Use .mousePressed() to specify behavior on press.

Examples

let button;
function setup() {
  createCanvas(100, 100);
  background(0);
  button = createButton('click me');
  button.position(19, 19);
  button.mousePressed(changeBG);
}

function changeBG() {
  let val = random(255);
  background(val);
}

Parameters

label label displayed on the button

value? value of the button