Pregunta

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!

¿Fue útil?

Solución

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/

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top