Changing Window size moves vector start point.

I am trying to set the window size with Preferredbackbufferheight in initialize() and its working fine but it seems to change spritebatch.draw() coodrinates. For example, if I set the window height to 800 it still thinks that the vector 0,0 is at the default 480 window size. Anyone know a fix or a way to change the vectors 0,0 location?

(ps: changing the width doesn’t break anything)

Does GraphicsDevice.Viewport reflect the new window height after the change? If not, try setting it manually.

1 Like

I get this too, but if I set it so the window is sizable and then click to maximise it, it sorts it all out. If I run it at full screen the issue does not occur.

Thanks! that worked. For others with the same issue I set left the preffedbufferheight in initialize and set GraphicsDevice.Viewport = new Viewport(0, 480 - size, 800, 800) in draw() (where 480 is the default window size and size is the desired size).

This work but was not the cause. Apparently I had my second class inherit the game1 class and that was messing with the display. Removing the inheritance fixed it.