Dan335 Posted June 26, 2016 Share Posted June 26, 2016 I'm trying to set up mouse events to move an isometric map. Everything I've tried breaks pixi.js' sprite events. I have a container that holds the ground sprites and another for buildings. It seems like I should put them on the ground container but then the building events don't work. If I put a mousedown callback on both containers only the one for the ground fires even though it is rendering underneath the other container. Quote Link to comment Share on other sites More sharing options...
Dan335 Posted June 26, 2016 Author Share Posted June 26, 2016 I think I figure it out. The world is divided up into areaContainers. I turn their visibility off if they're not onscreen. stage |-areaContainer | |- groundContainer | |- buildingContainer | |-areaContainer | |- groundContainer | |- buildingContainer | |-areaContainer |- groundContainer |- buildingContainer needs to be stage |- groundContainer | |- areaContainer | |- areaContainer | |- areaContainer | |- buildingContainer |- areaContainer |- areaContainer |- areaContainer Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 26, 2016 Share Posted June 26, 2016 Hello! Which version of PIXI are you using? Unfortunately, I cant pinpoint your problem using that information. Yes, there are many problems with Interaction, and to solve them one must have a demo that reproduces the bug. Please create a demo with few containers and sprites, with simple textures, that shows it. btw, that thing can help you with ordering elements for rendering: https://github.com/pixijs/pixi-display Quote Link to comment Share on other sites More sharing options...
Dan335 Posted June 26, 2016 Author Share Posted June 26, 2016 I'm using 3.0.11. Changing the tree made it work. Not sure if it's a bug? The only bad thing is it's about twice as slow to render, not sure why. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 26, 2016 Share Posted June 26, 2016 @Dan335 sorry, still not enough data. 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.