Reputation: 189
how do I draw a line beginning from fixed coordinates to the actual mouse position?
show_connect_line = new Kinetic.Line({
points : [parseInt(show_connect_line_beginx), parseInt(show_connect_line_beginy),parseInt(stage.getMousePosition().x),parseInt(stage.getMouePosition().y)],
name : 'line',
stroke : '#555',
strokeWidth : 2,
lineCap : 'butt',
id : 'show_connect_line'
});
This doesn't work because of "getMousePosition()"
THX!
Upvotes: 0
Views: 102
Reputation: 105035
You have a typo in your code:
stage.getMouePosition().y s/b stage.getMousePosition().y
BTW, The current version of KineticJS uses stage.getPointerPosition(). That may be a problem also.
A Demo: http://jsfiddle.net/m1erickson/fF8AP/
Upvotes: 1