Skip to content

Instantly share code, notes, and snippets.

@talentless
Created April 10, 2012 18:41
Show Gist options
  • Save talentless/2353579 to your computer and use it in GitHub Desktop.
Save talentless/2353579 to your computer and use it in GitHub Desktop.
// quick ugly hack to get touches working on the prototype
if (type === "touchstart" || type === "touchmove" || type === "touchend") {
pos=Crafty.DOM.translate(e.touches[0].clientX, e.touches[0].clientY);
e.x = e.touches[0].clientX;
e.y = e.touches[0].clientY;
}
if (type === "touchstart") type = "mousedown";
else if (type === "touchmove") type = "mousemove";
else if (type === "touchend") type = "mouseup";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment