alex_h Posted August 6, 2021 Share Posted August 6, 2021 Say I have two sprites, one the size of the screen, and one 100px circle in front of that. Both are interactive. The full screen one has a listener for pointerup events, and the circle in front has a listener to pointerdown events. Is there a way to make the circle allow pointerup events to continue to propagate so that if the user happens to pointerup over it, the event continues to get processed by the full screen sprite behind it? I am interested in solutions that work for all pixi versions >= 4 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 6, 2021 Share Posted August 6, 2021 propagation does work only to parents, not to siblings. You can make it that sprite immune to pointerUp , you have to make your own TreeSearch for that, copy original and add whatever is needed there: https://github.com/pixijs/pixijs/blob/01a69a1465b875cb7b97a10caa9c35d9505397ff/packages/interaction/src/TreeSearch.ts#L36 , it was introduced in v5. You can override things with "renderer.plugins.interaction.search = new MyTreeSearch()". In v4 you have to do the same with processInteractive method inside interactionManager itself Quote Link to comment Share on other sites More sharing options...
alex_h Posted August 7, 2021 Author Share Posted August 7, 2021 Ok thanks for your reply Ivan. I found it was easier to come up with an alternative approach to work around the problem in the end. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Iustin Posted August 20, 2021 Share Posted August 20, 2021 One situation here too: Let's say we have multiple sprites(circles images) created from an array with object, and when we click on one circle it's moving from left to right(only the one we clicked). When the one is moving I want to make the others interactive=false, but if I'm doing that the one that is moving will stop because it can't find the events(not sure if I explained right but hope someone understand). How I can make the others not interactive but also keep the event on the one that is moving? 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.