user2349387
user2349387

Reputation: 1

Get Position of Drag & Drop Element

i am using the following code: http://www.html5canvastutorials.com/kineticjs/html5-canvas-drag-and-drop-a-group-with-kineticjs/ for Drag & Drop.

My question is: How can i get the actual position (x,y) of a group after being dragged and dropped?

Upvotes: 0

Views: 3032

Answers (1)

lavrton
lavrton

Reputation: 20288

You can use events of kinetic objects - http://www.html5canvastutorials.com/kineticjs/html5-canvas-path-mouseover/ In your case - 'dragend'.

group.on('dragend',function(){
    console.log(group.getPosition());
});

example: http://jsfiddle.net/lavrton/xEsDZ/

Upvotes: 1

Related Questions