Passing mouse events to the object behind
by Novack · in iTorque 2D · 05/24/2011 (9:08 am) · 8 replies
Hi guys, Im looking for a way to set an object to pass the mouse events to the object beneath it.
The practical case, is a t2dStaticSprite appearing on top of another, and I want to receive clicks on the first object, as if the appearing sprite doesnt exist.
Ive looked into some options, but there seems to be no simple way of doing this. Disabling useMouseEvents seems to make the object ignore the mouse events, but then no ones catches them.
Any ideas?
The practical case, is a t2dStaticSprite appearing on top of another, and I want to receive clicks on the first object, as if the appearing sprite doesnt exist.
Ive looked into some options, but there seems to be no simple way of doing this. Disabling useMouseEvents seems to make the object ignore the mouse events, but then no ones catches them.
Any ideas?
About the author
http://cyberiansoftware.com.ar/
#2
Is that what you meant.
05/24/2011 (5:24 pm)
Yes. I can and do/have used mouseEvents on objects that were hidden behind layers of other nonMouse using objects. Also, have mouseUsingObjects that lay behind other objects but can only be used when if certain globals allow it. Is that what you meant.
#3
05/24/2011 (5:35 pm)
Also, if you set the "mouseLocked" flag on an object, it will respond to mouse events no matter where the screen is touched.
#4
When I setUseMouseEvents(false), I still get the object "obstructing" preventing the "obstructed" from receiving the mouse click event.
I'll check again this tomorrow early, and come back to you.
Thanks for the help fellas.
05/24/2011 (7:22 pm)
I think you guys understood what I need, however Im not getting the same results as you. (?)When I setUseMouseEvents(false), I still get the object "obstructing" preventing the "obstructed" from receiving the mouse click event.
I'll check again this tomorrow early, and come back to you.
Thanks for the help fellas.
#6
The problem is that some "obstructing objects" are GuiMLTextCtrl which doesnt seem to be affected by UseMouseEvents, nor makeFirstReponder...
I need GuiMLTextCtrl controls to let pass any mouse input throught them.
Any ideas?
05/25/2011 (9:04 am)
So it was working, in part.The problem is that some "obstructing objects" are GuiMLTextCtrl which doesnt seem to be affected by UseMouseEvents, nor makeFirstReponder...
I need GuiMLTextCtrl controls to let pass any mouse input throught them.
Any ideas?
#7
05/25/2011 (10:40 am)
This is just a guess, but in your GuiMLTextCtrl object, look at the "Profile" field, e.g. Profile = "GuiDefaultProfile". Then, find that "GuiDefaultProfile" (or whatever the Profile name is). In that object, there should be a field called "modal". If "modal" is true, then it will respond to mouse events. If "modal" is false, then it will not respond to mouse events. So, try setting that GuiControlProfile's 'modal' value to false.
Torque Owner Richard Skala
Pixel Vandals Inc.