Skip to content
Easily manage the window resolution of an MonoGame project
C# PowerShell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ResolutionBuddy
.gitattributes moved into nuget package Mar 31, 2016
.gitignore
.gitmodules clean externs Mar 31, 2016
LICENSE.txt
README.md

README.md

ResolutionBuddy

This is a library for managing the resolution of a MonoGame project.

You give it the virtual resolution, which is the target of the game. Then it tries to set up the screen to match your target. It has the option to either letter box and keep the exact desired virtual resolution, otherwise it can change the virtual resolution to match the screen aspect ratio. Using this library, you don't have to change any code or assets to support multiple resolutions.

Base on code from david-amador.com

To use this library, install the Nuget pacakge: https://www.nuget.org/packages/ResolutionBuddy/

public Game1()
{
	graphics = new GraphicsDeviceManager(this);

	//initialize the ResolutionBuddy library. 
	//This will have game space of 720p but on a 3/4 aspect ratio window with letterbox
	IResolution resolution = new ResolutionComponent(this, graphics, new Point(1280, 720), new Point(1024, 768), false, true);

	...
}

protected override void Draw(GameTime gameTime)
{
	graphics.GraphicsDevice.Clear(Color.Black);

	//Pass the TransformationMatrix to the Begin method to draw from game space -> screen space
	spriteBatch.Begin(SpriteSortMode.Immediate, 
					  BlendState.AlphaBlend, 
					  null, null, null, null,
					  Resolution.TransformationMatrix());

	...

	spriteBatch.End();

	base.Draw(gameTime);
}

To see an example project, check out https://github.com/dmanning23/ResolutionBuddyExample

You can’t perform that action at this time.