public override void Draw(GameTime gameTime) { //Calculate Proper Viewport according to Aspect Ratio ResolutionAdapter.ResetViewport(); base.Draw(gameTime); }
public override void Initialize() { base.Initialize(); //initialize the ResolutionAdapter object ResolutionAdapter = new ResolutionAdapter(_graphics); ResolutionAdapter.SetVirtualResolution(VirtualResolution.X, VirtualResolution.Y); ResolutionAdapter.SetScreenResolution(ScreenResolution.X, ScreenResolution.Y, _fullscreen, _letterbox); ResolutionAdapter.ResetViewport(); //initialize the Resolution singleton Resolution.Init(ResolutionAdapter); }
public void ResetViewport() { //Calculate Proper Viewport according to Aspect Ratio ResolutionAdapter.ResetViewport(); }
public Matrix TransformationMatrix() { return(ResolutionAdapter.TransformationMatrix()); }
public Vector2 ScreenToGameCoord(Vector2 screenCoord) { return(ResolutionAdapter.ScreenToGameCoord(screenCoord)); }