Game Development Community

CursorOff() doesn't work

by Matthew W · in Torque Game Engine · 02/18/2008 (1:40 pm) · 1 replies

When using the tutorial.base tutorial, in the world editor, you are allowed to move the camera while holding down the right mouse button and then a cursor shows up when you release that mouse button.* That is want i want to do.

Right now, using the advancedCamera tutorial, we set orbitMode and have the setPlayerObject set to an object (like one of the logos from the gameOne tutorial) instead of the player.

Well, i have run into a problem when trying to enable the cursor - once it is on it just stays on.. the right clicking doenst work for rotating the camera any more.

moveMap.bind( mouse, button1, button1Clicked );


function button1Clicked(%val) {

  
      

    if (%val) {

        CursorOff();
        moveMap.bind( mouse, xaxis, rotateCameraHorizontal);
        moveMap.bind( mouse, yaxis, rotateCameraVertical);
        moveMap.bind( mouse, zaxis, zoomCamera);

    }
    else {
        moveMap.bind( mouse, xaxis, NULL );
        moveMap.bind( mouse, yaxis, NULL );
        moveMap.bind( mouse, zaxis, NULL );

        CursorOn();
    }
}

Why doesn't the CursorOff(); function work? Any help would be greatly appreciated - we have been working on this for about two weeks. i've been just checking and hoping for some help each day. Hope you can help.

ps. *is there any way to take advantage of this?