OK, I've got some information for you. You can use Mouse.SetPosition
method to keep the cursor within the bounds of the window. Just be sure to only call that when the window is in focus and not minimized. Also keep in mind that the position is relative to the top-left corner of the window.
Now for the movement, that is simply comparing the current mouse state with the center of the window. Then you'd need to call SetPosition
to put the cursor back in the center of the window. So something like this:
void Update()
{
Rectangle center = this.Window.ClientBounds;
MouseState newState = Mouse.GetState();
double angle = Math.Atan2(newState.Y - center.Y, newState.X - center.X);
// Change camera angle. Needs to be tuned to your wants most likely.
Mouse.SetPosition((int)center.X, (int)center.Y);
}
On a side note, there is a more dedicated version of this website: gamedev.stackexchange.com. Also, I must put in a disclaimer, this was a learning experience for me and unfortunately I lack the time to test the above code.