Example #1
0
        public override void Draw(GameTime gameTime)
        {
            //Calculate Proper Viewport according to Aspect Ratio
            ResolutionAdapter.ResetViewport();

            base.Draw(gameTime);
        }
Example #2
0
        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);
        }
Example #3
0
 public void ResetViewport()
 {
     //Calculate Proper Viewport according to Aspect Ratio
     ResolutionAdapter.ResetViewport();
 }
Example #4
0
 public Matrix TransformationMatrix()
 {
     return(ResolutionAdapter.TransformationMatrix());
 }
Example #5
0
 public Vector2 ScreenToGameCoord(Vector2 screenCoord)
 {
     return(ResolutionAdapter.ScreenToGameCoord(screenCoord));
 }