Question
eye follow cursor, in animate htm5 js canvas
hi, I need help I have this code to make an eye follow cursor, in animate htm5 js canvas but it doesn't work for me:
...
stage.canvas.style.cursor = "none";
this.eye.mouseEnabled = false;
this.addEventListener("mouseMove", move.bind(this));
var root = this();
function move(event) {
var var1 = mouseX - pendulo.x;
var var2 = mouseY - pendulo.y;
var radius = Math.atan2(var1,var2);
var degree = radius /(Math.PI/180);
root.eye.rotation = degree;
}
...please help me.
