How to fix this:
On a 1600x900 resolution:
On a 1920x1080 resolution:
How to fix this:
On a 1600x900 resolution:
On a 1920x1080 resolution:
One possibility is to render everything to a Render Target which has a defined resolution (always the same). You would render everything to this Render Target instead the backbuffer (“directly to the screen”). Then the final step is to just take your Render Target and render this to the actual size of your Game window. So everything will be upscaled for you. Does this approach makes sense for you?
Can you give an example code?
RenderTarget2D gameRT;
...
protected override void LoadContent()
{
gameRT = new RenderTarget2D(GraphicsDevice, VIRTUAL_WIDTH, VIRTUAL_HEIGHT);
}
...
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.SetRenderTarget(gameRT);
...
GraphicsDevice.SetRenderTarget(null);
_spriteBatch.Begin();
_spriteBatch.Draw(gameRT, new Rectangle(0, 0, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight), Color.White);
_spriteBatch.End();
}
Check out this article
http://www.david-amador.com/2010/03/xna-2d-independent-resolution-rendering/