hammerjs

Externs of hammer.js - Javascript touch gestures library
https://github.com/adireddy/haxe-hammer

To install, run:

haxelib install hammerjs 0.1.0 

See using Haxelib in Haxelib documentation for more information.

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.

Contributors
adireddy
Version
0.1.0
Published
1 year ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github