Game Development Community

GUI Buttons are onMouseUp! Can i make it onMouseDown?

by Red Ring · in Torque Game Engine · 10/11/2011 (3:06 am) · 1 replies

I have this problem with the GUI Buttons.

GUI buttons act as a "onMouseUp". I'd like it to act as a "onMouseDown" so when it is pushed the function is immediately activated. Can anyone help me on this matter? Timing is crucial on the game I'm making.

#1
10/14/2011 (4:20 pm)
Red@ look at your torque scripts, .cs and .gui related to this GUI.

there is a callback for ::onMouseUp() and ::onMouseDown() which can be defined.

in other words, I have a gui which lets the player choose a mission.

...
      new GuiButtonCtrl(ChooseLevelDlgGoBtn) {
...

And at the bottom of the GUI file, (2) functions defined;
function ChooseLevelDlgGoBtn::onMouseUp( %this )
{
   echo(">> ChooseLevelDlgGoBtn::onMouseUp <<");
}

function ChooseLevelDlgGoBtn::onMouseDown( %this )
{     
   echo(">> ChooseLevelDlgGoBtn::onMouseDown <<");
}

... maybe that will help.