hammerjs 0.1.0

Externs of hammer.js - Javascript touch gestures library

Released 2017-05-12.

To install, run:

haxelib install hammerjs 0.1.0

See using Haxelib in Haxelib documentation for more information.

Maintaineradireddy
Websitehttps://github.com/adireddy/haxe-hammer
Current version0.1.0
StatisticsInstalled 722 times
LicenseMIT
Tags

README.md

haxe-hammer

Externs of HAMMER.JS for Haxe - Javascript touch gestures library.

Installation

haxelib install hammerjs

Demo

[http://adireddy.github.io/demos/haxe-hammer](http://adireddy.github.io/demos/haxe-hammer/)

Usage

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.