KineticJS - update text layer with new mouse position
问题 I am using the following to get the mouse position: var coordinate = 0; ............ canvas1.addEventListener('mousemove', function (evt) { var mousePos = getMousePos(canvas1, evt); var nY = Math.round(mousePos.y); var nX = Math.round(mousePos.x); coordinate = "x=" + nX + ", y=" + nY; $('#pValue').val(coordinate); }, false); It works great if I display the value in a text field; however I could not update a text layer: dlayerA1Text = new Kinetic.Layer(); var simpleTextRight = new Kinetic.Text