   XNA Curosr Problem
  Hi guys,I'm new to C# and XNA but I'm trying to get used to it anyway and I'm having a small problem.I'm trying to attach a sprite to the cursor position using Mouse.GetState().X and Mouse.GetState().Y but what these return don't match up with the actual cursor position. Can anyone shed some light on the problem please?   
  The Mouse.GetState().X and Mouse.GetState().Y Fuctions are most likely the relative movement of the mouse.If you develop for Pc you can use Cursor.Position in System.Windows.Forms to obtain screencoordinates. To transform them into client coordinates use <yourcontrol>.ScreenToClient().Second posibility is to make use of a IMessageFilter and capture windowmessages (the hard way).If you develop for XBox I don't know how to obtain coordinates (I usualy use Directx9 and c# for windows not XNA).Hope this helps.   ;  The Mouse.GetState() functions gives the mouse position relative to the rendering surface. The top left corner would be (0, 0) and the bottom right corner would be the same as (backBufferWidth, backBufferHeight).If your program runs in windowed mode, Mouse.GetState() will continue to return the mouse coords _relative_ to the rendering window. So if the cursor is left of the form, the X-value actually becomes negative.If you want the absolute position of the cursor, you could do for example (if i remember correctly):cursorX = Window.ClientBounds.X + Mouse.GetState().X;cursorY = Window.ClientBounds.Y + Mouse.GetState().Y;However, regarding your question I suspect the problem lies in the cursor texture you use. If the cursor is drawn in the center of the texture, you would have to substract half of the texture width\height from the cursor position to align it properly.   ;Quote: However, regarding your question I suspect the problem lies in the cursor texture you use. If the cursor is drawn in the center of the texture, you would have to substract half of the texture width\height from the cursor position to align it properly.Thats not the problem. I should have mentioned that the texture size is 64x64 and the difference between the actual position of the cursor and the sprite is in the region of 200 pixels. Quote: To transform them into client coordinates use <yourcontrol>.ScreenToClient().Sorry, like i said I'm new and I don't know what you mean <yourcontrol>, what is this?   ;  Can you show us some code?   ;  I'm not sure what else to give you.I've already mentioned the code that seems to be giving the problemhere it is anyway  v2_Position.X = Mouse.GetState().X;  v2_Position.Y = Mouse.GetState().Y;;  Is your sprite lagging the cursor, or just not matching up at all?   ;  Not matching up at all, its staying a constant distance away the entire time   ;  Go to XNA creators club and download the picking example. It has a Cursor component that draws a custom cursor. That may give you some inspiration.The link: It's third from the bottomGood luck!   ;  OK i'm not sure what happened, but i rearranged some other code and now it works.Thanks for all your help though guys   