Game Development Community

How to change cursor when mouse moves over GuiBitMapCtrl

by Stanley D Chatman · in Torque Game Builder · 09/15/2006 (7:21 am) · 1 replies

I am looking for a way to be able to change the cursor when the mouse is over a GuiBitMapButtonCtrl. I was able to get the sound working properly for the mouseover and mousedown with a guibitmapbuttonctrl but I need the cursor to change.

I found this thread: www.garagegames.com/mg/forums/result.thread.php?qt=28812

But I would like to accomplish this without any source mods.


If someone has this working let me know

#1
09/15/2006 (9:10 am)
As far as I know the GUI system does no script-accessible actions during mouse-over on bitmapButtonCtrls, hence the engine mod you mention (which works beautifully by the way; you may want to reconsider implementing it.)

There are a few alternatives with more work, which may or may not accomplish what you're looking for. First, there's the guiMouseEventCtrl, which does track mouse movements and clicks inside its area and does callbacks like 'onMouseEnter', 'onMouseLeave', 'onMouseMove' etc. If you were to overlay these as invisible objects over your buttons, and set their profile to be modeless (e.g. not trap the mouse but pass events on to controls beneath it) you may have the mechanism you seek. On the other hand, setting the mouseEventCtrl modeless might disable its ability to track the mouse at all, in which case you'd basically need to use the mouseEventCtrl to do ALL button click-tracking as well, and just use a GuiBitmapCtrl instead of a button underneath it.

As a second option, you could overlay a TGB scene above the gui and use the mouse events in that to do something similar. Again, the Gui object for the scene needs to be modeless in order to not block actual clicks on the buttons. I know this works, as I use a SceneWindow control over guis to do animated cursors with trails and stuff.