Azmyth.XNA.frmSettings.frmSettings C# (CSharp) Method

frmSettings() public method

public frmSettings ( AzmythGame game, GraphicsDeviceManager graphics ) : System
game AzmythGame
graphics GraphicsDeviceManager
return System
        public frmSettings(AzmythGame game, GraphicsDeviceManager graphics)
            : base(new Rectangle(0, 0, 300, 300), true)
        {
            Game = game;
            m_graphicsManager = graphics;

            Rectangle = new Rectangle((game.GraphicsDevice.Viewport.Width / 2)-150, (game.GraphicsDevice.Viewport.Height / 2) - 120, 300, 240);

            XnaGUIManager.Controls.Add(this);

            pnlMain = new XGPanel(new Rectangle(0, 0, 300, 240));
            lstResolutions = new XGListBox(new Rectangle(10, 10, 280, 150));

            foreach (DisplayMode mode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes)
            {
                if(mode.Width >= 800 && mode.Height >=600)
                lstResolutions.Items.Add(mode.Width + " x " + mode.Height);
            }

            lstResolutions.SelectedIndex = 0;
            chkFullScreen = new XGCheckBox(new Rectangle(10, 170, 25, 25), "Fullscreen");
            chkFullScreen.Checked = false;

            btnApply = new XGButton(new Rectangle(300-220, 200, 100, 30), "Apply", this.btnApply_Clicked);
            btnExit = new XGButton(new Rectangle(300-110, 200, 100, 30), "Exit", this.btnExit_Clicked);

            Children.Add(pnlMain);
            pnlMain.Children.Add(lstResolutions);
            pnlMain.Children.Add(chkFullScreen);
            pnlMain.Children.Add(btnApply);
            pnlMain.Children.Add(btnExit);
        }