Game Development Community

Platform mouse cursors and setMouseLocked

by Matt Brasier · in Torque Game Engine Advanced · 05/20/2009 (2:58 pm) · 1 replies

I have used the resource here
http://www.garagegames.com/community/resources/view/15453
To add custom cursors to the game I am working on, and it worked great, but when we changed the game to use setMouseLocked to pin the mouse to our window, the custom HW cursors no longer work (except when using the TGEA console, or a menu). From my debugging so far, it appears that the custom HW cursor is set, but then TGEA starts using a completely different set cursors. The win32CursorController still thinks my HW cursor is active, but the cursor displayed is neither my custom HW cursor, nor the default HW cursor.

Any pointers to where I should be looking to fix this? Does setMouseLocked switch to SW cursors? and if so, is there an easy way to change that, or should I be looking at using TGE type SW cursors?

Matt

#1
05/27/2009 (4:26 am)
It seems that calling setMouseLocked causes TGEA to switch to software cursors (GuiCursor) rather than platform cursors.

My guess is that you can't lock an OS cursor to a specific window, so TGEA hides it and uses a SW cursor. Does this sound right to people before I go digging in the code?

It looks like I will have to convert the .ani cursors to GuiCursor objects.