www.webdeveloper.com
Results 1 to 3 of 3

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

  1. #1
    Join Date
    Feb 2012
    Posts
    18

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

  2. #2
    Join Date
    Aug 2007
    Posts
    3,767
    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
    Posts
    18
    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



Recent Articles