Legomite Posted August 25, 2015 Share Posted August 25, 2015 I have some sprites that are used as a gui element. I also have a event on the canvas that places blocks on the position I click on. Is there a way to disable the event when I click on certain sprites? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted August 25, 2015 Share Posted August 25, 2015 Hi Legomite Could you put a big (background) sprite and put the event on that instead of the canvas? This way, any sprites on top pf the background, that have an event pf their own won't trigger the one below. Quote Link to comment Share on other sites More sharing options...
Legomite Posted August 25, 2015 Author Share Posted August 25, 2015 Hi Legomite Could you put a big (background) sprite and put the event on that instead of the canvas? This way, any sprites on top pf the background, that have an event pf their own won't trigger the one below.I can't get the position of my click, I usedbg.click = bg.tap = function(event) {} Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted August 26, 2015 Share Posted August 26, 2015 Hi Legomite If you're using 2.0 (which I recommend), this should work ... bg.click = bg.tap = function(x, y) { console.log(x);} Let me know if it works for you 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.