예제 #1
0
 public IngameMenu(int width, int height) : base(width, height)
 {
     this.background = Properties.Resources.popup;
     resume          = new Button();
     saveGame        = new Button();
     quitToMain      = new Button();
     this.buttons    = new Button[3] {
         resume, saveGame, quitToMain
     };
     for (int i = 0; i < buttons.Length; i++)
     {
         buttons[i].Location                          = new Point(480, (180 + (125 * i)));
         buttons[i].Size                              = new Size(308, 108);
         buttons[i].BackgroundImage                   = Properties.Resources.mainmenubutton;
         buttons[i].BackgroundImageLayout             = ImageLayout.None;
         buttons[i].BackColor                         = Color.Transparent;
         buttons[i].FlatAppearance.BorderSize         = 0;
         buttons[i].FlatAppearance.MouseDownBackColor = Color.Transparent;
         buttons[i].FlatAppearance.MouseOverBackColor = Color.Transparent;
         buttons[i].FlatStyle                         = FlatStyle.Flat;
         buttons[i].Font                              = new Font(Form1.font.Families[0], 20, FontStyle.Regular);
     }
     this.resume.Text     = "Resume";
     this.saveGame.Text   = "Save Game";
     this.quitToMain.Text = "Quit to Main Menu";
     this.quitConfirm     = null;
 }
예제 #2
0
 public MenuState(int width, int height)
 {
     this.width       = width;
     this.height      = height;
     this.quitConfirm = null;
 }
예제 #3
0
        public GameState(Game game, int width, int height)
        {
            this.FileName             = null;
            this.game                 = game;
            this.menu                 = null;
            this.endGamePopup         = null;
            this.background           = Properties.Resources.gamebackground;
            this.width                = width;
            this.height               = height;
            this.p1Score              = new Label();
            this.p2Score              = new Label();
            this.activePlayerReminder = new Label();
            this.colonyButton         = new Button();
            this.tradeButton          = new Button();
            this.menuButton           = new Button();
            this.buttons              = new Button[3] {
                colonyButton, tradeButton, menuButton
            };
            for (int i = 0; i < buttons.Length; i++)
            {
                buttons[i].Size = new Size(108, 108);
                buttons[i].BackgroundImageLayout             = ImageLayout.None;
                buttons[i].BackColor                         = Color.Transparent;
                buttons[i].FlatAppearance.BorderSize         = 0;
                buttons[i].FlatAppearance.MouseDownBackColor = Color.Transparent;
                buttons[i].FlatAppearance.MouseOverBackColor = Color.Transparent;
                buttons[i].FlatStyle                         = FlatStyle.Flat;
            }
            this.colonyButton.BackgroundImage = Properties.Resources.colonybutton_on;
            this.tradeButton.BackgroundImage  = Properties.Resources.colonybutton_trade_off;
            this.menuButton.BackgroundImage   = Properties.Resources.mainmenubutton;
            this.colonyButton.Location        = new Point(954, 294);
            this.tradeButton.Location         = new Point(1092, 294);
            this.menuButton.Location          = new Point(960, 630);
            this.menuButton.Size = new Size(248, 88);
            this.menuButton.BackgroundImageLayout = ImageLayout.Zoom;
            this.menuButton.Text = "Menu";
            this.menuButton.Font = new Font(Form1.font.Families[0], 22, FontStyle.Regular);

            this.p1Score.AutoSize  = true;
            this.p1Score.BackColor = Color.Transparent;
            this.p1Score.ForeColor = Color.White;
            this.p1Score.Location  = new Point(964, 524);
            this.p1Score.Font      = new Font(Form1.font.Families[0], 22, FontStyle.Regular);

            this.p2Score.AutoSize  = true;
            this.p2Score.BackColor = Color.Transparent;
            this.p2Score.ForeColor = Color.White;
            this.p2Score.Location  = new Point(964, 574);
            this.p2Score.Font      = new Font(Form1.font.Families[0], 22, FontStyle.Regular);

            this.activePlayerReminder.AutoSize  = true;
            this.activePlayerReminder.Location  = new Point(980, 125);
            this.activePlayerReminder.Font      = new Font(Form1.font.Families[0], 24, FontStyle.Regular);
            this.activePlayerReminder.ForeColor = Color.White;
            this.activePlayerReminder.BackColor = Color.Transparent;

            this.colonyNumbers = new Label[2];
            for (int i = 0; i < colonyNumbers.Length; i++)
            {
                colonyNumbers[i]           = new Label();
                colonyNumbers[i].AutoSize  = true;
                colonyNumbers[i].Location  = new Point(980 + (140 * i), 395);
                colonyNumbers[i].Font      = new Font(Form1.font.Families[0], 22, FontStyle.Regular);
                colonyNumbers[i].ForeColor = Color.Black;
                colonyNumbers[i].BackColor = Color.Transparent;
            }
        }