Game Development Community

MouseMove cannot be called if interface inside

by Samme Ng · in Torque Game Engine · 12/30/2003 (2:23 am) · 1 replies

Hi all,

I would like to use the mouse to click on the terrain and moving to there, however, while I have .pushDialog some interface to the canvas, which the extent is 800x600, causing it received all of the mouse event and doesn't pass to GameTSCtrl to handle.

I found thaat I must have a GuiControl to include a GuiWindowCtrl in order to work properly, but it must be a full screen bound.

What can I do to make the GameTSCtrl to receive the mouse event?

Thanks.

Samme

#1
12/30/2003 (1:27 pm)
I believe you can make a control non-modal. There is a guiProfile called GuiModelessDialogProfile.

MainChatHud uses this profile, and is placed on the screen with a call to Canvas.pushDialog( MainChatHud ), in the onWake event of PlayGui. It does not obscure your mouse events.

Some parts of the editor also use this. Grep the scripts for 'modal' and "GuiModelessDialogProfile' to see all the instances.

The other solution, bit messy, is to pass the events up the gui parent chain. This doesnt work for controls added via pushDialog, but works well for controls that are added to another control. Most controls should not pass events up, so add a flag to control click-through. Never pass mouse events up to a menu control's parent, the engine will recurse forever.