XNA Creators Club Online
Page 1 of 1 (1 items)
Sort Posts: Previous Next

Why does MouseState.X change after checking MouseState.MiddleButton?

Last post 18/05/2009 18:21 by Vinlaen. 0 replies.
  • 18/05/2009 18:21

    Why does MouseState.X change after checking MouseState.MiddleButton?

    I was having trouble drawing a simple ray until I noticed something very strange...

    After checking MouseState.MiddleButton (or any button) the X, Y mouse coordinates change!

    For example:

    MouseState ms = Mouse.MouseState()

    if (ms.MiddleButton == ButtonState.Pressed)
    {
      // Do something
    }

    // ms.X and ms.Y might be (0, 0) at this point, but if you check Mouse.GetState().X/Y you might see (203, 481) or something extremely different.

    Anybody know what is causing this?
Page 1 of 1 (1 items) Previous Next