Game Development Community

Mouse Cursor Ingame

by NathanJHIS · in Torque Game Engine · 11/25/2005 (7:53 pm) · 8 replies

I am right now trying to figure out how to make it so I can have the mouse cursor working ingame like in the editor so I can look about and everything but be able to use the mouse cursor to click on buttons like in this image

www.interceptorshield.com/images/ISDScreenShot.jpg

#1
11/25/2005 (8:13 pm)
I believe there's either a function or a variable somewhere called cursorOn. I'm not completely sure as I've never used it, but I do remember seeing that in a thread somehwere. I believe it might have been a thread about Leave No Survivors.
#2
11/25/2005 (10:23 pm)
Yup, there's a magic field of this nature. I don't recall the name. Do some searches of the scripts for cursor and you'll rapidly find it.
#3
11/25/2005 (11:44 pm)
Here's what I added to get the cursor for the object selection resource...

/starter.fps/client/scripts/default.bind.cs

moveMap.bind(keyboard, "m",  "toggleMouseLook");

function toggleMouseLook(%val)
{
   if(%val)
   {
      if(Canvas.isCursorOn())
         CursorOff();
      else
         CursorOn();
   }
}
#4
11/26/2005 (3:41 am)
You can do 2 things

Call the cursorOn() or cursorOff() script methods
or simply add a noCursor = false; to your playGui.gui GameTSCtrl object

new GameTSCtrl(PlayGui) {
noCursor = false;
[all the rest here]
#5
11/26/2005 (5:14 am)
Well I got it so the mouse cursor shows up but I want to be able to look up and down with the mouse. thats my main problem.
#6
11/26/2005 (5:29 am)
I think this resource has the functionality that you need (if I understand correctly):
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3645
#7
11/26/2005 (7:48 am)
Ok one more question :D

Anyone know about setting up guipopupmenucontrol so the pop up has a list of selections one can click?
#8
01/03/2007 (2:37 am)
I have same question, How can I have cursor in game and
use mouse right button+move up/down to change my view?