Exemplo n.º 1
0
 public WorldSettings()
 {
     WindowResolution = new Resolution(800, 600);
     GumpResolution = new Resolution(800, 600);
     IsMaximized = false;
     Mouse = new MouseSettings(MouseButton.Left, MouseButton.Right);
     AlwaysRun = false;
 }
Exemplo n.º 2
0
 private void SetGraphicsDeviceWidthHeight(Resolution resolution)
 {
     GraphicsDeviceManager.PreferredBackBufferWidth = resolution.Width;
     GraphicsDeviceManager.PreferredBackBufferHeight = resolution.Height;
     GraphicsDeviceManager.SynchronizeWithVerticalRetrace = Settings.Game.IsVSyncEnabled;
     GraphicsDeviceManager.ApplyChanges();
 }
Exemplo n.º 3
0
 private void OnWindowSizeChanged(object sender, EventArgs e)
 {
     GameWindow window = (sender as GameWindow);
     Resolution resolution = new Resolution(window.ClientBounds.Width, window.ClientBounds.Height);
     // this only occurs when the world is active. Make sure that we don't reduce the window size
     // smaller than the world gump size.
     if (resolution.Width < Settings.World.GumpResolution.Width)
         resolution.Width = Settings.World.GumpResolution.Width;
     if (resolution.Height < Settings.World.GumpResolution.Height)
         resolution.Height = Settings.World.GumpResolution.Height;
     SetGraphicsDeviceWidthHeight(resolution);
 }