mouse_valid

Posted By: JazzDude

mouse_valid - 03/13/10 18:58

Can this command be used to make the windows mouse null outside of the game window?

I don't understand the manual example and haven't had any luck trying it out.

Thanks for any suggestions.
Posted By: Xarthor

Re: mouse_valid - 03/13/10 19:43

No this flag does only indicate if the mouse pointer is in your application window or not.
It does not allow you to make the mouse "stick" to your game window.

But what you can do with this flag is: whenever a mouse click (e.g.) occures or you use mouse_force somewhere, you can check the mouse_valid flag before letting the action happen.
So if your character should only turn when the mouse pointer is inside the game window you could use the following snippet:
Code:
...
if(mouse_valid)
{
  my.pan += 8 * mouse_force.x * time_step;
}
...



Hope this explains it a little bit.
Posted By: JazzDude

Re: mouse_valid - 03/13/10 20:34

Yes, that explains it.
Thanks.
© 2024 lite-C Forums