Skip to content

Instantly share code, notes, and snippets.

@fdrobidoux
Created June 5, 2019 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fdrobidoux/10b71ea4e4e5cc163fbc9645468e8a56 to your computer and use it in GitHub Desktop.
Save fdrobidoux/10b71ea4e4e5cc163fbc9645468e8a56 to your computer and use it in GitHub Desktop.
[MonoGame] Scale by resolution
private const float RESOLUTION_W = 1280;
private const float RESOLUTION_H = 720;
float scaleW = graphics.GraphicsDevice.Viewport.TitleSafeArea.Width / RESOLUTION_W;
float scaleH = graphics.GraphicsDevice.Viewport.TitleSafeArea.Height / RESOLUTION_H;
scale = new Vector2(scaleW, scaleH);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment