Disabling mouse events
by Maxime Jouin · in Torque Game Engine · 04/10/2007 (9:12 am) · 3 replies
Hello,
I am looking for a way to disable all mouse events during a certain period of time (I transform the mouse cursor into an hourglass while I do work in the backround and I do not want the user to clicl anywhere during that time). Searching the forum I found the following line of code:
sceneWindow2D.setUseWindowMouseEvents( false );
But this gives the following error message: "Unable to find object 'sceneWindow2D' ". Is this obsolete? Is there another way to do this?
Thank you for any help.
I am looking for a way to disable all mouse events during a certain period of time (I transform the mouse cursor into an hourglass while I do work in the backround and I do not want the user to clicl anywhere during that time). Searching the forum I found the following line of code:
sceneWindow2D.setUseWindowMouseEvents( false );
But this gives the following error message: "Unable to find object 'sceneWindow2D' ". Is this obsolete? Is there another way to do this?
Thank you for any help.
Torque 3D Owner Drew Parker
One simple way to disable clicks would be to push a dummy GuiControl to the top of the Canvas, and have it cover the whole screen. You'd need to set the horiz and vert settings to be "width" and "height."
This will block all the incoming clicks from going to your GUIs, and instead they will hit the dummy control and do nothing.
I can't think of the commands off the top of my head, here is some pseudo code:
%dummyGui = new GuiControl() { position= "0 0"; extent = "10 10"; horizSizing = "width"; vertSizing = "height"; ... }; PlayGui.add(%dummyGui);Then when you are done, something like: