Game Development Community

Mouse "World Limits"?

by Robin King · in Torque Game Builder · 07/01/2011 (12:27 pm) · 0 replies

I'm working on an idea for a game mechanic right now that's similar to the strategy used for the TDN Breakout tutorial. In the tutorial, the mouse is obviously locked to the center of the screen, and instantaneous changes are observed for control.
The difference I'm seeking help on is similar, but instead of locking the mouse to the center and using instantaneous movement elsewhere, I'm interested in locking the mouse inside of its own little box for control based on x,y position inside the box and only inside the box.
Is there a tutorial I could look at showing an example of limiting the mouse's x,y kind of like an object's "world limit" set to clamp would be?

TL;DR: Is there a way to constrain the mouse cursor within a set space without removing the free use of the mouse in that space?

About the author

Recent Threads