Game Development Community

GuiBitmapButtonCtrl onButtonDown type event.

by Peterjohn Griffiths · in Torque Game Builder · 06/26/2011 (6:02 am) · 1 replies

I have created a HUD with a Jump GuiBitmapButtonCtrl.
I have set the command to make my player Jump.
When the button is pressed down, nothing happens until you release it.
I need an onButtonDown event and an onButtonUp event for a Gui control like pressing a key down on the keyboard. The Gui doesn't need to be a button Ctrl, so long as it has the two events.
Anyone know how to do this?.
Many thanks.

#1
06/26/2011 (9:40 am)
After looking through the Engine, I found the GUI control onMouseDown and onMouseUp events don't trigger consolef methods.
Because of this the functionality I require can't be done through the control.
A workaround is to place a GuiMouseCtrl over the button and have that process the onMouseDown and onMouseUp events instead.
Works well and will do for what I need.
I think it would be a good idea to enable these events in a future release of TGB in all Gui controls incase someone else needs them. Makes it more user friendly for a couple of lines of code.