Skip to content

Instantly share code, notes, and snippets.

@edwardsanchez
Created August 30, 2014 23:48
Show Gist options
  • Save edwardsanchez/b14f2408cb4d5c5f3e9b to your computer and use it in GitHub Desktop.
Save edwardsanchez/b14f2408cb4d5c5f3e9b to your computer and use it in GitHub Desktop.
If just using event.x it doesn't work on a touch device and you'll get NaN To get the x and y coordinates you must add event = Events.touchEvent(event) and then call for event.clientX instead of event.x
Dragger = new Layer
x: 0
y: 100
width: 100
height: 100
Dragger.draggable.enabled = true
Dragger.on Events.DragMove, (event)->
event = Events.touchEvent(event)
print event.clientX, event.clientY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment