Ninjadoodle Posted March 7, 2018 Share Posted March 7, 2018 Hi @enpu Is there an easy way in Panda 2, to stop taps/clicks on objects underneath another? Let's say I want to darken the screen and show a message, with an ok button. Do I have to manually disable all the interactive objects underneath? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
enpu Posted March 7, 2018 Share Posted March 7, 2018 @Ninjadoodle What i usually do, is make an empty container with custom hitArea that is the size of the game. All interactive items under that container won't then receive events anymore. Then put your button in top of that container. var container = new game.Container(); container.hitArea = new game.Rectangle(game.width, game.height); container.interactive = true; Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
enpu Posted March 7, 2018 Share Posted March 7, 2018 https://www.panda2.io/examples#container-hitArea Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 7, 2018 Author Share Posted March 7, 2018 Hi @enpu Thanks heaps! That’s an awesome tip 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.