Skip to content

Instantly share code, notes, and snippets.

@patricoferris
Last active February 21, 2018 11:47
Show Gist options
  • Save patricoferris/26fcd7606b5d48cb1e4f200612f2a8ef to your computer and use it in GitHub Desktop.
Save patricoferris/26fcd7606b5d48cb1e4f200612f2a8ef to your computer and use it in GitHub Desktop.
var touch = false;
function setup(){
createCanvas(640, 640);
}
function draw(){
if(touch){
fill(255, 0, 0);
rect(mouseX, mouseY, 20, 20);
}
}
function touchStarted(){
touch = true;
}
function touchEnded(){
touch = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment