hyperandroid / CAAT

Canvas Advanced Animation Toolkit
hyperandroid.github.com/CAAT
MIT License
727 stars 117 forks source link

Get mouseDrag coordinates in CAAT #108

Closed Jeyabalan closed 11 years ago

Jeyabalan commented 11 years ago

I can retrieve x and y co-ordinates using mouseEvent on mouseDown, mouseUp, mouseMove, etc. But how to retrieve x and y co-ordinates on every instant of mouseDrag ? Also is there way to snap an actor to some point ?

hyperandroid commented 11 years ago

Each mouseXXX function receives an event object with on-screen and locar-to-the-actor mouse coordinates:

e.point.x, e.point.y for screen coords. e.x, e.y for local in-actor coords.

And you can disable input on an actor at any given moment with actor.enableEvents(false).

Hope this helps.

2012/12/26 Jeyabalan notifications@github.com

I can retrieve x and y co-ordinates using mouseEvent on mouseDown, mouseUp, mouseMove, etc. But how to retrieve x and y co-ordinates on every instant of mouseDrag ? Also is there way to snap an actor to some point ?

— Reply to this email directly or view it on GitHubhttps://github.com/hyperandroid/CAAT/issues/108.

hyperandroid commented 11 years ago

e.screenPoint.x, e.screenPoint.y for screen coordinates. sorry.

2012/12/26 hyperandroid hyperandroid@gmail.com

Each mouseXXX function receives an event object with on-screen and locar-to-the-actor mouse coordinates:

e.point.x, e.point.y for screen coords. e.x, e.y for local in-actor coords.

And you can disable input on an actor at any given moment with actor.enableEvents(false).

Hope this helps.

  • ibon

2012/12/26 Jeyabalan notifications@github.com

I can retrieve x and y co-ordinates using mouseEvent on mouseDown, mouseUp, mouseMove, etc. But how to retrieve x and y co-ordinates on every instant of mouseDrag ? Also is there way to snap an actor to some point ?

— Reply to this email directly or view it on GitHubhttps://github.com/hyperandroid/CAAT/issues/108.