Game Development Community

Adding gui disables mouse capture

by Interface · in Torque Game Engine · 02/05/2007 (10:42 pm) · 7 replies

I have just worked through the tutorial and getting accustomed to torque 1.4.2.
When adding the gui text as proposed by the engine (pressing f10, adding guitextctrl), when i exit and come back into the level, the mouse cursor shows up and mouselook is not enabled.
When i replace the playgui with the original empty tutorial one, mouselook is back.

i am guessing adding the textcrtrl is changing some property on that gui but haven't been able to find it. The tutorial comes with a script for the playgui.gui. I have added the settext and left the scorecounter text property empty, and the score:0 shows up meaning this function is actually getting executed. So the enabledirectinput etc should be executing too.
Properties on the gui?

function PlayGui::onWake(%this)
{
// Turn off any shell sounds...
// alxStop( ... );
$enableDirectInput = "1";
activateDirectInput();

ScoreCounter.setText("Score: 0");

// Activate the game's action map
moveMap.push();
}

Thanks.

#1
02/06/2007 (12:06 am)
Add the following to the GameTSCtrl

noCursor = "1";

Like so:

new GameTSCtrl(PlayGui) {
   profile = "GuiContentProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "640 480";
   minExtent = "8 8";
   visible = "1";
   cameraZRot = "0";
   forceFOV = "0";
   noCursor = "1"; <<<<<<<
#2
02/06/2007 (6:57 am)
Thanks, that worked. Looks like that added it to the "dynamic fields" list of the top level gui control.
#3
02/11/2007 (3:03 am)
I actually got the same problem, but with 1.5.. and it dosent seem to be any nocursor in the GameTSCtrl... help?
#4
02/11/2007 (11:15 am)
Just open the .GUI file manually and add the noCursor = "1". It works wonders :-)
Add it to your top level GUI control.
#5
02/11/2007 (11:26 am)
Thank you! :)
#6
02/11/2007 (1:34 pm)
At the top of your gui under play gui add this line canSaveDynamicFields = "1";
like this:
new GameTSCtrl(PlayGui) {
   canSaveDynamicFields = "1";
   Profile = "GuiContentProfile";
   HorizSizing = "right";
   VertSizing = "bottom";
   position = "0 0";
   Extent = "1024 768";
   MinExtent = "8 8";
   canSave = "1";
   Visible = "1";
   tooltipprofile = "GuiContentProfile";
   hovertime = "1000";
   applyFilterToChildren = "1";
   cameraZRot = "0";
   forceFOV = "0";
      noCursor = "1";

TomFeni
#7
02/14/2007 (4:49 pm)
Thanks so much for this. I was tearing my hair out trying to figure out what happened to the mouse.