Skip to content
Jiashan Wu edited this page Aug 11, 2015 · 2 revisions

p5 + Hammer.js

(Brief introduction for hammer.js and gestures)

Setup

Need

  • hammer.js or hammer.min.js

Adding Hammer event listeners into p5 sketch

function setup(){
  var myCan = createCanvas(windowWidth, windowHeight);
  var element = document.getElementById(myCan.elt);
  mc = new Hammer(element);

  mc.on("press", function(e){ // add other Hammer event listeners here
    // something happens here
  }); 
}

Examples/Template

Resources

Clone this wiki locally