Game Development Community

Mouse up problem...

by Steven Hine · in Torque Game Builder · 06/01/2008 (8:15 am) · 2 replies

I've made buttons with a gui that trigger a $buttonNote variable. What I'm trying to do is to reset the varible to 'Z' when the left mouse button goes up. I need the timing of the button press with a trigger on the screen.

Here's my code for mouseUp, but it doesn't seem to work...

/////////////////////////////////////
// Mouse up fuction
/////////////////////////////////////
function sceneWindow2D::onMouseUp(%this, %mod, %worldPostion, %mouseClicks )
{
    $ButtonNote = "Z";
    echo("mouse up");
}

It works for first level but not the next... Should this code go in the main.cs or game.cs file?? (Right now I have it in the game.cs file.)

#1
06/01/2008 (5:45 pm)
I dont really understand what you're asking... do you think you could be a lil more especific on what do you wanna do?
#2
06/01/2008 (7:31 pm)
I'm trying to use onMouseUp to reset a variable to null or Z. I think because one of my objects is as big as the screen, sceneWindow2D doesn't register the mouse click. For now I've put the reset into an onUpdate callback and it seems to work right now.