Game Development Community

onMouseMove function not working?

by Sean Oloughlin · in Torque 3D Professional · 08/08/2012 (6:44 am) · 3 replies

function PlayGui::onMouseMove(%this)
{
echo("draged!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
when i move my mouse the onMouseMove doesnt seem to run?

#1
08/08/2012 (7:35 am)
That may be because I don't see any implemented callbacks in the engine for this function.

See guiControl.cpp
void GuiControl::onMouseMove(const GuiEvent &event)
{
   //if this control is a dead end, make sure the event stops here
   if ( !mVisible || !mAwake )
      return;

   //pass the event to the parent
   GuiControl *parent = getParent();
   if ( parent )
      parent->onMouseMove( event );
}

Further inspection to GuiTSCtrl leads a similar find, no callbacks.

You might want to start there, or implement an override call on this for your needs.
#2
08/08/2012 (8:36 pm)
You got it Rob. I was looking for it myself for the RTS Prototype. Turns out that onMouseDragged() isn't exposed to the console either.
#3
08/09/2012 (9:39 pm)
thanks guys for you help i added the call back

if( isMethod( "onMouseMove" ) )
{
makeScriptCall( "onMouseMove", evt );
}