aPaperjs. setInterval is working, only in case of, if mouse is move
Hello.
I want make the circle and after every 1 second x position this circle
increases with 5 px.
this is my code:
var x = 20;
var center = new Point(x,20);
var radius = 10;
var myCircle = new Path.Circle(center,radius);
myCircle.fillColor = '#090';
function positionChange () {
x = x + 5;
myCircle.position = new Point(x,20);
}
setInterval(positionChange,1000);
But this code works vary strange, that is, if mouse is move, position
circle is changed, but if mouse is delayed, circle position not change
o_O.
Pleease tell me why?
Because it only updates the canvas onmousemove, it's not designed for such animation. You can either read through the library source and work out how to manually update it, or contact the developers of paper.js.
Great wit and madness are near allied, and fine a line their bounds divide.
Bookmarks