Ninjadoodle Posted July 8, 2014 Share Posted July 8, 2014 Is there a way I can make a whole container and the included sprites interactive? Right now, if I set up a layer container and put sprites in it, I can enable interactivity on the individual sprites, but enabling and disabling interactivity on the layer/container does nothing. Any way to do this without having to change the interactivity of each sprite, or the entire scene? Thank you in advance! Quote Link to comment Share on other sites More sharing options...
Alvin Posted July 9, 2014 Share Posted July 9, 2014 I don't know if Panda has a better way of doing it, but from Pixi.s point of view I would simply do this : for(var i = 0; i<container.children.length; i++){ container.children.interactive = true;} Which makes only the children of this container interactive Good luck Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted July 10, 2014 Author Share Posted July 10, 2014 Perfect! That's exactly what I need Thank you heaps for your help! Just out of interest ... if I set a a container.visible to true/false, then it affects all the children of that container. How come setting container.interactive to true/false doesn't do the same? 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.