Game Development Community

How to make a guicontrol "transparent" to mouse click?

by Sean Xie · in Torque 2D Beginner · 03/14/2014 (9:28 am) · 4 replies

I don't know if the title makes sense. Basically what I am trying to achieve is to make a showing guicontrol object not respond to mouse click, without blocking the click. Say, I have a GuiSpriteCtrl A moving with my mouse. I want to be able to click on whatever other GuiControl even though A is blocking the mouse click.
Any ideas?

#1
03/14/2014 (2:54 pm)
From what I see in the engine source code you should be able to just set the active field to false like so without any ill effects to disable user interaction events with the control:
spriteCtrlObject.active = false;
#2
03/14/2014 (9:45 pm)
I tried doing this. It certainly disables user interaction events, but the inactive object still blocks the events.
I think maybe I was not clear enough on the question. I want to make the mouse click events work as if the object is not on the screen, but with the object visible on the screen. Am I making any sense?
#3
03/14/2014 (11:35 pm)
Is a "modalless" gui profile what you're looking for?

if (!isObject(Gui_Profile_Modalless))
{

new GuiControlProfile(Gui_Profile_Modalless)
{

modal=false;

};

}
#4
03/15/2014 (11:43 am)
This is exactly what I was looking for!
Thanks!!