Skip to content

Instantly share code, notes, and snippets.

@lizzybrooks
Created November 13, 2017 19:11
Show Gist options
  • Save lizzybrooks/e4e30ee0c9598776d9214d73cebf0d35 to your computer and use it in GitHub Desktop.
Save lizzybrooks/e4e30ee0c9598776d9214d73cebf0d35 to your computer and use it in GitHub Desktop.
var button;
function setup() {
createCanvas(400, 400);
background(0);
button = createButton('click me');
button.position(19, 19);
//object.mousePressed(function() { yourFunction(yourInputs);});
button.mousePressed(function() {makeCircle(random(0,400),random(0,400));});
}
function draw(){
makeCircle(200,200);
}
function changeBG() {
var val = random(255);
background(val);
}
function makeCircle(x,y) {
ellipse(x,y, 50,50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment