Lock the cursor in the window
in
Programming Questions
•
3 months ago
I'm currently doing some minor tests for a RTS-style game, and I've successfully coded the visual means for selecting player-controlled units (though this doesn't actually select them yet, it's just drawing the box correctly where the user clicks).
I've kind of fudged in a way for it to not select anything outside of the screen by limiting the size of the box to the screen's edges, but preferably I want to stop the cursor from leaving the screen at all, as then I can eventually have mouse-based map scrolling like many other RTS games have.
Is this possible?
I've kind of fudged in a way for it to not select anything outside of the screen by limiting the size of the box to the screen's edges, but preferably I want to stop the cursor from leaving the screen at all, as then I can eventually have mouse-based map scrolling like many other RTS games have.
Is this possible?
1