Game Development Community

Getting mouse input in t2dSceneWindow control

by game4Rest · in Torque Game Builder · 04/10/2006 (7:50 pm) · 3 replies

Hi, all.

I'm using Beta 1.1 and having some problem with getting mouse input.

I made a t2dSceneWindow named SkarosWindow. To make it get mouse input,
I made a code like this,


function SkarosWindow::onMouseDown(%this, %modi, %worldPos, %clicks)
{
     messageBoxOk("", "Mouse Down","");
}

But when any GUI or Map is above this SkarosWindow, it can not receive mouse input.
It seems like any layer above the t2dSceneWindow is intercepting the mouse input.

Can I solve this problem? Any advice will be highly appreciated.

Hong Jin

#1
04/11/2006 (9:19 am)
Are the GUIs above the SkarosWindow using a profile that has "modal = false;" set?

If not, then yes I believe higher GUIs will intercept all input, including the mouse events. You could set modal = false on all GUIs above the SkarosWindow or pass the events down yourself manually from the higher windows to the lower.
#2
04/11/2006 (9:30 pm)
Hi Luke,

Thanks alot for your answer.

I have a AvatarSelectionGui above the SkarosWindow. As you advised, I made a new profile like this.

if(!isObject(GuiModalessProfile)) new GuiControlProfile (GuiModalessProfile : GuiDefaultProfile)
{
	modal = false;
};

*edit*
With this, I had some problem at first but finally I made a success.

BTW, when the map data is above the t2dSceneWindow, I can't make it receive mouse input either. Have you
ever experienced the same?

Thank you in advace.

Hong Jin
#3
04/12/2006 (5:56 am)
If I have to chose another strategy when I work with .map file, I've found a hint from above post.
It is making functions t2dTileLayer::onMouse~. But I'd like keep using t2dSceneWindow::onMouse~ functions
if it is possilbe.

Hope someone give me any help.

Thanks you in advance.

Hong Jin