coter Posted September 24, 2015 Share Posted September 24, 2015 And again new day new problem. http://codepen.io/anon/pen/rOMJJP?editors=001 On the mousemove event is subscribed circle. Why react the whole stage? Quote Link to comment Share on other sites More sharing options...
babycarlitos Posted September 24, 2015 Share Posted September 24, 2015 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. Quote Link to comment Share on other sites More sharing options...
coter Posted September 24, 2015 Author Share Posted September 24, 2015 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 Quote Link to comment Share on other sites More sharing options...
babycarlitos Posted September 24, 2015 Share Posted September 24, 2015 ok here is the linkhttp://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!! Quote Link to comment Share on other sites More sharing options...
coter Posted September 24, 2015 Author Share Posted September 24, 2015 ok here is the linkhttp://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. Quote Link to comment Share on other sites More sharing options...
babycarlitos Posted September 24, 2015 Share Posted September 24, 2015 Ok so you wanted to use existing pixi functions as I see containsPoint(event.data.global) vs doing it my way ( bounds). Glad it worked out for you! coter 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.