Game Development Community

Help with centering the mouse pointer

by Leon Tee · in Torque Game Engine · 04/20/2003 (11:15 am) · 0 replies

When the mouse cursor is displayed using cursorON() from torque script, i'd like to center the mouse cursor.

However, when I use setCursorPos(x,y) from torquescript, it seems to set the value in the point variable CursorPt in GuiCanvas, but it immediately get set back when another mouse event occurs.

e.g. my current pointer position may be (100,100) and i use setCursorPos(200,200). I use outputting to the log to make sure that it's setting correctly, and yes it is. The moment i move the mouse, right click, un-left click ... it sets the value in cursorPt back to 100,100 since thats where the pointer appears next.

Is this normal?
If it is, how would i go about fixing it?
Does anyone *definately* know whether setCursorPos works?

Plz reply if u know anything that might help!