I am trying to use Hammer.js events within the Kinetic.js canvas and can't seem to get it working. I have tried both of the following:
var background = new Kinetic.Rect({
x: 0,
y: 0,
width: image.getWidth(),
height: image.getHeight(),
id: "background",
fill: 'rgba(159, 255, 200, 0.0)',
});
pointLayer.add(background);
pointLayer.draw();
background.hammer().on('tap', function (e) {
console.log("Background tapped");
});
OR
Hammer(background).on('tap', function (e) {
console.log("Background tapped");
});
When using the first method, I get an error "has no method 'hammer'". The other I get no messages. Is it possible to use Hammer.js within the Kinetic.js canvas?