Results 1 to 3 of 3

Thread: aPaperjs. setInterval is working, only in case of, if mouse is move

Hybrid View

  1. #1
    Join Date
    Feb 2012

    aPaperjs. setInterval is working, only in case of, if mouse is move

    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);


    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
    Pleease tell me why?
    Last edited by dadli; 05-07-2012 at 04:28 PM.

  2. #2
    Join Date
    Aug 2007
    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.

  3. #3
    Join Date
    Feb 2012
    Declan1991 Thank you

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center