www.webdeveloper.com
Results 1 to 5 of 5

Thread: change circle color, if mouse is on this circle ?

  1. #1
    Join Date
    Feb 2012
    Posts
    18

    change circle color, if mouse is on this circle ?

    Hello, question about paperjs.
    is this code:
    Code:
    var circle = new Path.Circle(new Point(80, 50), 30); 
    circle.fillColor = 'red'; 
    function onMouseMove(event) { 
        if (circle.bounds.contains(event.point)) { 
            circle.fillColor = 'green'; 
        } else { 
            circle.fillColor = 'red'; 
        } 
    }
    if mouse is on the Circle, color circle is changed, but its working
    bad, color is changed also, if mouse is nearer with cirle.
    question: how to make so, that color is changed only if mouse is on
    the Circle ?
    Last edited by dadli; 05-10-2012 at 04:31 AM.

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    what paperjs is?
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Feb 2012
    Posts
    18

  4. #4
    Join Date
    Feb 2012
    Posts
    18
    problem is solved

  5. #5
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    wow! such a nice link! thanks )
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

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