예제 #1
0
        public ResolutionComponent(Game game, GraphicsDeviceManager graphics, Point virtualResolution, Point screenResolution, bool fullscreen, bool letterbox) : base(game)
        {
            _graphics         = graphics;
            VirtualResolution = virtualResolution;
            ScreenResolution  = screenResolution;
            _fullscreen       = fullscreen;
            _letterbox        = letterbox;

            Game.Components.Add(this);

            Game.Services.AddService <IResolution>(this);

            ResolutionAdapter = new ResolutionAdapter(_graphics);
            ResolutionAdapter.SetVirtualResolution(VirtualResolution.X, VirtualResolution.Y);
            ResolutionAdapter.SetScreenResolution(ScreenResolution.X, ScreenResolution.Y, _fullscreen, _letterbox);
            ResolutionAdapter.ResetViewport();
        }
예제 #2
0
 public void ResetViewport()
 {
     ResolutionAdapter.ResetViewport();
 }
예제 #3
0
 public override void Draw(GameTime gameTime)
 {
     ResolutionAdapter.ResetViewport();
     base.Draw(gameTime);
 }