Add a way to control which object is clicked #10421
AlexandreSi
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In versions 7 and 8, the way a user interacts with Pixi objects with their mouse/screen touches is handled by specifying an object's
eventMode
(https://pixijs.com/8.x/guides/components/interaction).This single parameter applies to any kind of interaction (click, right-click, touch, etc.).
In a use-case where Pixi is used as a canvas for a user to display objects here and there (some bigger than the others, with overlaps or complete obfuscation), it prevents setting fine-tuned interaction.
For example, we could consider that for a click, an object should be interactive, and for a right-click, the object should not be interactive anymore.
I imagine a system where an interaction event is propagated through every object that the mouse/touch was above, respecting the z order with each object having the possibility to stop the propagation.
That is very much like how HTML/CSS handles it I guess.
I had troubles finding other posts mentioning this issue so I might have missed an existing discussion about this.
Does it seem reasonable to you?
Or is there a way to tweak a class to achieve such behaviors?
Beta Was this translation helpful? Give feedback.
All reactions