I’m trying to get the coordinates of a rectangle while an animation is in action. You can see the code and type of animation here: http://jsfiddle.net/2UZM3/
As one can see, at the end of the animation the coordinates are printed. I want the coordinates to update permanently while the rectangle is moving.
Thank you for your help!
PS: The source code is originally from here: http://www.html5canvastutorials.com/kineticjs/html5-canvas-transition-easing-functions-with-kineticjs/
You could add a handler for
stage.onFramewhich outputs the item’s coordinates. Simply start thestagewhen the user clicks the button to start the animation, and stop thestagewhen the callback on thetransitionTomethod is executed:Updated fiddle here.