Ninjadoodle Posted November 3, 2014 Share Posted November 3, 2014 Hi guys Just wondering whether there is a way to disable clickable objects, when another clickable object is on top. Example - I have a red ufo and a blue ufo (both clickable), When the red ufo moves behind the blue ufo, I only want blue ufo to take action (if clicked), because it is in front. Thank you in advance for any help Quote Link to comment Share on other sites More sharing options...
Sandy Posted November 3, 2014 Share Posted November 3, 2014 PandaJS relies on the PIXI JS interaction manager which doesn't provide the functionality you're looking for. It simply loops through all objects that could have been hit and calls the click event on them. I suggest you raise this question on the PIXI forums, or submit a PR for PIXI with a fix for it. Also worth checking if the PIXI dev branch has had any work done on this feature. Quote Link to comment Share on other sites More sharing options...
enpu Posted November 3, 2014 Share Posted November 3, 2014 @Ninjadoodle, it should work just as you described. I just tried with two interactive sprites, and only the front one gets it's click function called (if i click on point where they are overlapping). There might be something wrong with your code, can you show some? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted November 3, 2014 Author Share Posted November 3, 2014 Hi Guys Thank you for your help @enpu - I've been trying to make a 50% fade overlay with a menu popup. I thought that the '50% fade overlay' should be blocking clicks for the buttons underneath, as it is 'interactive'. After playing around, I've realised that if I give the '50% fade overlay' and empty function (I don't want it to do anything, just block clicks), then it does just that. Is this the correct approach to this situation? Thank you again for your help! Quote Link to comment Share on other sites More sharing options...
enpu Posted November 4, 2014 Share Posted November 4, 2014 Yeah it must be interactive and have interaction function (click, tap, mousedown etc). Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted November 4, 2014 Author Share Posted November 4, 2014 Hi @enpu Cool, thank you! Just wanted ti make sure I was going about it the right way 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.