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

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