Sign in to follow this  
coter

Mousemove not working.

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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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!!

Share this post


Link to post
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.

 

   

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.