Jump to content

Mousemove not working.


coter
 Share

Recommended Posts

Hello, 

What are you trying to achieve?. The mousemove is working.The circle flickers because you are saying to refill and draw the circle every time the mouse move. Maybe I can help you if you can describe what are you trying to accomplish. 

I want to redraw the circle when over it the cursor is

Link to comment
Share on other sites

ok here is the link

http://codepen.io/babycarlitos/pen/OyRwLz?editors=001

 

I copied your code and added some more to make it work.A few things:

 

1- At the beginning of your code you are not giving a size to the circle, so I just gave it the same size with a different color to tell the difference.

2- At the listener, I checked to see if the mouse is within the boundaries of the circle and if it is then make the change.

3- I kept the listener on the circle, but you dont have to. You can listen to just mouse movement and it would have been the same. 

4- Notice that if you move the mouse from an angle, the color will still change because we are not checking for alpha values. 

 

Hopefully this helps you out!!

Link to comment
Share on other sites

ok here is the link

http://codepen.io/babycarlitos/pen/OyRwLz?editors=001

 

I copied your code and added some more to make it work.A few things:

 

1- At the beginning of your code you are not giving a size to the circle, so I just gave it the same size with a different color to tell the difference.

2- At the listener, I checked to see if the mouse is within the boundaries of the circle and if it is then make the change.

3- I kept the listener on the circle, but you dont have to. You can listen to just mouse movement and it would have been the same. 

4- Notice that if you move the mouse from an angle, the color will still change because we are not checking for alpha values. 

 

Hopefully this helps you out!!

You misunderstood :)  For me it is not difficult to make a point belonging to the circumference.

I wanted to learn how to do the validation programmatically. And I did and I even corrected the example, which You changed after. :) But thanks anyway for You help.

 

   
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...