Wouldn't the cursor appear on the window if your using
Mouse.SetPosition(x,y, window)
?
Anyways you want to take your view into account aswell incase you someday want to move the view.
float x
= sprite
.Position.X - window
.GetView().Center.X + window
.GetView().Size.X / 2;float y
= sprite
.Position.Y - window
.GetView().Center.Y + window
.GetView().Size.Y / 2;Mouse
.SetPosition(new Vector2i
((int)x,
(int)y
), window
);
Plus, remember to set origin for your sprite.