Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

point towards mouse wick editor

onEvent('update', function () {
    pointTo(this, mouseX, mouseY);
});

function pointTo(obj, loc_x, loc_y) {
    angle = Math.atan2(loc_x - obj.x, - (loc_y - obj.y) )*(180/Math.PI);      
    obj.rotation = angle;
}
Source by forum.wickeditor.com #
 
PREVIOUS NEXT
Tagged: #point #mouse #wick #editor
ADD COMMENT
Topic
Name
3+2 =