Game Development Community

Stop mouse event propagation [solved]

by Rpahut · in Torque Game Builder · 07/21/2010 (7:51 pm) · 2 replies

Hello!
How do I stop mouse event propagation after it was processed? I have some overlapping sprites on the scene, and I want nearest object only to receive mouse event - if I clicking an object, I want this particular object to react, not all objects at that point in the scene.

#1
07/21/2010 (11:32 pm)
Instead of using mouse events on the objects, you can use mouse events on the scene window instead. Then, I use pickPoint to get a list of objects at the coordinates passed by the mouse event. The first object returned from pickPoint() is the top object and you can then a a function on that object to process the click.
#2
07/22/2010 (10:13 am)
Thank you!