Externs of HAMMER.JS for Haxe - Javascript touch gestures library.
haxelib install hammerjs
http://adireddy.github.io/demos/haxe-hammer
import hammer.Hammer;
import hammer.Manager;
import hammer.recognizers.Rotate;
import hammer.GestureInteractionData;
import js.Browser;
import js.html.HtmlElement;
class Main {
public function new() {
// get a reference to an element
var stage:HtmlElement = cast Browser.document.getElementById("stage");
// create a manager for that element
var mc:Manager = new Manager(stage);
// create a recognizer
var rotate = new Rotate();
// add the recognizer
mc.add(rotate);
// subscribe to events
mc.on("rotate", function(e:GestureInteractionData) {
// do something cool
var rotation = Math.round(e.rotation);
stage.style.transform = "rotate(" + rotation + "deg)";
});
}
}
This content is released under the MIT License.
hammer.js is written by Jorik Tangelder (Eight Media) and licensed under the MIT License.