コード例 #1
0
        public PauseController(Form1 parent, MainController mainMenu, RunController run)
        {
            this.parent   = parent;
            this.mainMenu = mainMenu;
            this.run      = run;
            font          = new Font("Rockwell", 16);
            scenePanel    = new Panel()
            {
                Size            = new Size(300, 300),
                BackgroundImage = Properties.Resources.pauseBackground,
                Parent          = parent
            };
            scenePanel.Location = new Point(parent.ClientSize.Width / 2 - scenePanel.Width / 2,
                                            parent.ClientSize.Height / 2 - scenePanel.Height / 2);

            headline = new Label()
            {
                Size      = new Size(scenePanel.Width, 50),
                TextAlign = ContentAlignment.MiddleRight,
                Font      = font,
                BackColor = Color.Transparent
            };

            toMain = new Label()
            {
                Size      = new Size(scenePanel.Width, 50),
                Text      = "Main menu",
                Font      = font,
                BackColor = Color.Transparent,
                TextAlign = ContentAlignment.MiddleCenter
            };
            toMain.MouseEnter += Label_MouseEnter;
            toMain.MouseLeave += Label_MouseLeave;

            nextLevel = new Label()
            {
                Size      = new Size(scenePanel.Width, 50),
                Text      = "Next Level",
                Font      = font,
                BackColor = Color.Transparent,
                TextAlign = ContentAlignment.MiddleCenter
            };
            nextLevel.MouseEnter += Label_MouseEnter;
            nextLevel.MouseLeave += Label_MouseLeave;

            scenePanel.Controls.Add(toMain);
            scenePanel.Controls.Add(headline);
            scenePanel.Controls.Add(nextLevel);
            scenePanel.Hide();
            toMain.Location    = new Point(toMain.Parent.Size.Width / 2 - toMain.Width / 2, toMain.Parent.Size.Height - toMain.Height);
            toMain.Click      += ToMain_Click;
            nextLevel.Location = new Point(toMain.Parent.Size.Width / 2 - toMain.Width / 2, toMain.Parent.Size.Height - toMain.Height - nextLevel.Height);
            nextLevel.Click   += NextLevel_Click;
        }
コード例 #2
0
        public MainController(Form1 parent)
        {
            this.parent = parent;

            scenePanel = new Panel()
            {
                Location        = parent.ClientRectangle.Location,
                Size            = parent.ClientRectangle.Size,
                BackgroundImage = Properties.Resources.background_menu,
                Parent          = parent
            };

            run = new RunController(parent, this);
            GetLevels();
            LevelSelectorScreen();
        }
コード例 #3
0
        public LeaderboardController(Form1 parent, MainController mainMenu, RunController run)
        {
            this.parent = parent;
            pauseMenu   = new PauseController(parent, mainMenu, run);

            font = new Font("Rockwell", 16);

            scenePanel = new Panel()
            {
                Size            = new Size(300, 300),
                BackgroundImage = Properties.Resources.pauseBackground,
                Parent          = parent
            };
            scenePanel.Location = new Point(parent.ClientSize.Width / 2 - scenePanel.Width / 2,
                                            parent.ClientSize.Height / 2 - scenePanel.Height / 2);

            scenePanel.Hide();
        }