Game Development Community

1.7.2 getMousePosition() failure

by Vern Jensen · in Torque Game Builder · 08/27/2008 (2:58 pm) · 3 replies

If I call getMousePosition() at program start-up or right after changing from full-screen to windowed mode, it returns incorrect values. Just try doing this at program startup after everything is loaded:

echo(sceneWindow2D.getMousePosition() );

As soon as you move the mouse, it'll return the correct value from that point on, until you switch between full/screen and windowed, in which case the value is again incorrect until the cursor is moved.

I believe this is a bug that's been here since 1.3.

-Vern

#1
08/27/2008 (3:23 pm)
Oh, and this is on a Mac. And I've been unable to use sceneWindow2D.setMousePosition() to avoid the problem. (I thought that maybe getMousePosition() would return the correct position if I had just set it with setMousePosition, but the problem still exists.)
#2
08/27/2008 (5:11 pm)
Vern, this doesn't happen on my PC. I'll add it to my list of bugs to verify on Mac and log it when I can.

Thanks boss
#3
08/27/2008 (6:42 pm)
Thanks Phil. If you ever need me to send code snippets or anything like that, I'm happy to help.