Disable crossHair and enable cursor
by gamer · in Torque Game Engine · 06/16/2006 (6:31 pm) · 2 replies
In my fps, initially there's only crossHair and no mouse cursor, I want to let the cursor reappear and then move it over to the control panel by the click of a key, so I did the following to enable the mouse cursor:
the problem is that the cursor doesn't really appear until the I move the crossHair to a collidable body, and then the crossHair is disabled and cursor appears.
so what else do I need to do besides set PlayGui.noCursor ="0" in order to disable the crossHair and enable the cursor dynamically.
thanks!
function gotoControlPanel()
{
error("goto control");
//moveMap.pop();
PlayGui.noCursor="0";
ControlPanel.noCursor="0";
%pos=ControlPanelCtrl.position;
Canvas.setCursorPos(%pos);
}the problem is that the cursor doesn't really appear until the I move the crossHair to a collidable body, and then the crossHair is disabled and cursor appears.
so what else do I need to do besides set PlayGui.noCursor ="0" in order to disable the crossHair and enable the cursor dynamically.
thanks!
About the author
#2
add the following to your defaultbinds.cs
It wont kill the crosshair, but it is probably more efficient and can be built upon.
06/16/2006 (7:48 pm)
Here you go...this will give you a cursor by pressing the "m" key:add the following to your defaultbinds.cs
function toggleMouseLook(%val)
{
if(%val)
{
if(Canvas.isCursorOn())
CursorOff();
else
CursorOn();
}
}
moveMap.bind(keyboard, "m", "toggleMouseLook");It wont kill the crosshair, but it is probably more efficient and can be built upon.
Torque Owner gamer
so how should I move the mouse cursor?
thanks!!