Example #1
0
        public override void Initialize()
        {
            title      = new Elements.Label(5, 5, "Circle");
            title.font = MineSweeper.contentManager.Load <SpriteFont>("Fonts/TitleFont");
            controls.Add(title);

            Elements.Button easy = new Elements.Button(0, 45, 256, 40, "Easy");
            easy.OnClick             = this.GetType().GetMethod("easyClick");
            easy.OnClickInvokeObject = this;
            controls.Add(easy);

            Elements.Button medium = new Elements.Button(0, 105, 256, 40, "Medium");
            medium.OnClick             = this.GetType().GetMethod("mediumClick");
            medium.OnClickInvokeObject = this;
            controls.Add(medium);

            Elements.Button hard = new Elements.Button(0, 165, 256, 40, "Hard");
            hard.OnClick             = this.GetType().GetMethod("hardClick");
            hard.OnClickInvokeObject = this;
            controls.Add(hard);

            Elements.Button custom = new Elements.Button(0, 225, 256, 40, "Custom");
            custom.OnClick             = this.GetType().GetMethod("customClick");
            custom.OnClickInvokeObject = this;
            controls.Add(custom);

            Elements.Button back = new Elements.Button(0, 285, 256, 40, "Back");
            back.OnClick             = this.GetType().GetMethod("backClick");
            back.OnClickInvokeObject = this;
            controls.Add(back);
        }
Example #2
0
        public override void Initialize()
        {
            title = new Elements.Label(5, 5, "Custom circle");
            title.font = MineSweeper.contentManager.Load<SpriteFont>("Fonts/TitleFont");
            controls.Add(title);

            lx = new Elements.Label(0, 48, "Radius");
            controls.Add(lx);
            lm = new Elements.Label(0, 78, "Mines");
            controls.Add(lm);

            r = new Elements.NumericTextBox(100, 45, 100, 20, "10");
            r.maxLength = 2;
            controls.Add(r);
            mines = new Elements.NumericTextBox(100, 75, 100, 20, "45");
            controls.Add(mines);
            mines.maxLength = 3;

            errors = new Elements.Label(250, 170, "");
            errors.foreground = Color.DarkRed;
            controls.Add(errors);

            back = new Elements.Button(0, 115, 100, 40, "Back");
            back.OnClick = this.GetType().GetMethod("backClick");
            back.OnClickInvokeObject = this;
            controls.Add(back);

            start = new Elements.Button(120, 115, 100, 40, "Play");
            start.OnClick = this.GetType().GetMethod("startClick");
            start.OnClickInvokeObject = this;
            controls.Add(start);
        }
Example #3
0
        public override void Initialize()
        {
            pMines = new Elements.Panel(0, 0, 160, 20);
            controls.Add(pMines);

            mines = new Elements.Label(5, 20, "");
            controls.Add(mines);

            pTime = new Elements.Panel(0, 0, 120, 20);
            controls.Add(pTime);

            time = new Elements.Label(5, 20, "");
            controls.Add(time);

            panel           = new Elements.Panel(0, 0, 200, 100);
            panel.isVisible = false;
            controls.Add(panel);

            state           = new Elements.Label(0, 0, "");
            state.isVisible = false;
            controls.Add(state);

            gameTime           = new Elements.Label(0, 0, "");
            gameTime.isVisible = false;
            controls.Add(gameTime);

            menu                     = new Elements.Button(0, 0, 180, 20, "Menu");
            menu.isVisible           = false;
            menu.OnClick             = this.GetType().GetMethod("menuClick");
            menu.OnClickInvokeObject = this;
            controls.Add(menu);

            MineSweeper.OnLevelLost += new MineSweeper.VoidEventHandler(MineSweeper_OnLevelLost);
            MineSweeper.OnLevelWon  += new MineSweeper.VoidEventHandler(MineSweeper_OnLevelWon);
        }
Example #4
0
 public override void Initialize()
 {
     Elements.Button sp = new Elements.Button(0, 20, 100, 20, "Single Player");
     sp.OnClick             = this.GetType().GetMethod("spClick");
     sp.OnClickInvokeObject = this;
     controls.Add(sp);
 }
Example #5
0
        public override void Initialize()
        {
            pMines = new Elements.Panel(0, 0, 160, 20);
            controls.Add(pMines);

            mines = new Elements.Label(5, 20, "");
            controls.Add(mines);

            pTime = new Elements.Panel(0, 0, 120, 20);
            controls.Add(pTime);

            time = new Elements.Label(5, 20, "");
            controls.Add(time);

            panel = new Elements.Panel(0, 0, 200, 100);
            panel.isVisible = false;
            controls.Add(panel);

            state = new Elements.Label(0, 0, "");
            state.isVisible = false;
            controls.Add(state);

            gameTime = new Elements.Label(0, 0, "");
            gameTime.isVisible = false;
            controls.Add(gameTime);

            menu = new Elements.Button(0, 0, 180, 20, "Menu");
            menu.isVisible = false;
            menu.OnClick = this.GetType().GetMethod("menuClick");
            menu.OnClickInvokeObject = this;
            controls.Add(menu);

            MineSweeper.OnLevelLost += new MineSweeper.VoidEventHandler(MineSweeper_OnLevelLost);
            MineSweeper.OnLevelWon += new MineSweeper.VoidEventHandler(MineSweeper_OnLevelWon);
        }
Example #6
0
 public override void Initialize()
 {
     Elements.Button sp = new Elements.Button(0, 20, 100, 20, "Single Player");
     sp.OnClick = this.GetType().GetMethod("spClick");
     sp.OnClickInvokeObject = this;
     controls.Add(sp);
 }
Example #7
0
        public override void Initialize()
        {
            title      = new Elements.Label(5, 5, "Custom circle");
            title.font = MineSweeper.contentManager.Load <SpriteFont>("Fonts/TitleFont");
            controls.Add(title);

            lx = new Elements.Label(0, 48, "Radius");
            controls.Add(lx);
            lm = new Elements.Label(0, 78, "Mines");
            controls.Add(lm);

            r           = new Elements.NumericTextBox(100, 45, 100, 20, "10");
            r.maxLength = 2;
            controls.Add(r);
            mines = new Elements.NumericTextBox(100, 75, 100, 20, "45");
            controls.Add(mines);
            mines.maxLength = 3;

            errors            = new Elements.Label(250, 170, "");
            errors.foreground = Color.DarkRed;
            controls.Add(errors);

            back                     = new Elements.Button(0, 115, 100, 40, "Back");
            back.OnClick             = this.GetType().GetMethod("backClick");
            back.OnClickInvokeObject = this;
            controls.Add(back);

            start                     = new Elements.Button(120, 115, 100, 40, "Play");
            start.OnClick             = this.GetType().GetMethod("startClick");
            start.OnClickInvokeObject = this;
            controls.Add(start);
        }
Example #8
0
        public override void Initialize()
        {
            title = new Elements.Label(5, 5, "Circle");
            title.font = MineSweeper.contentManager.Load<SpriteFont>("Fonts/TitleFont");
            controls.Add(title);

            Elements.Button easy = new Elements.Button(0, 45, 256, 40, "Easy");
            easy.OnClick = this.GetType().GetMethod("easyClick");
            easy.OnClickInvokeObject = this;
            controls.Add(easy);

            Elements.Button medium = new Elements.Button(0, 105, 256, 40, "Medium");
            medium.OnClick = this.GetType().GetMethod("mediumClick");
            medium.OnClickInvokeObject = this;
            controls.Add(medium);

            Elements.Button hard = new Elements.Button(0, 165, 256, 40, "Hard");
            hard.OnClick = this.GetType().GetMethod("hardClick");
            hard.OnClickInvokeObject = this;
            controls.Add(hard);

            Elements.Button custom = new Elements.Button(0, 225, 256, 40, "Custom");
            custom.OnClick = this.GetType().GetMethod("customClick");
            custom.OnClickInvokeObject = this;
            controls.Add(custom);

            Elements.Button back = new Elements.Button(0, 285, 256, 40, "Back");
            back.OnClick = this.GetType().GetMethod("backClick");
            back.OnClickInvokeObject = this;
            controls.Add(back);
        }
Example #9
0
        public override void Initialize()
        {
            title = new Elements.Label(5, 5, "Controls");
            title.font = MineSweeper.contentManager.Load<SpriteFont>("Fonts/TitleFont");
            controls.Add(title);

            Elements.Label info = new Elements.Label(5, 45, "<LMB> - Open tile  \n<RMB> - Mark mine  \n<LMB> + <RMB> - Open nearby tiles if possible  \nHold <LMB> to drag field  \n[ESC] - Exit to menu");
            controls.Add(info);

            back = new Elements.Button(0, 285, 256, 40, "Back");
            back.OnClick = this.GetType().GetMethod("backClick");
            back.OnClickInvokeObject = this;
            controls.Add(back);
        }
Example #10
0
        public override void Initialize()
        {
            title      = new Elements.Label(5, 5, "Controls");
            title.font = MineSweeper.contentManager.Load <SpriteFont>("Fonts/TitleFont");
            controls.Add(title);

            Elements.Label info = new Elements.Label(5, 45, "<LMB> - Open tile  \n<RMB> - Mark mine  \n<LMB> + <RMB> - Open nearby tiles if possible  \nHold <LMB> to drag field  \n[ESC] - Exit to menu");
            controls.Add(info);

            back                     = new Elements.Button(0, 285, 256, 40, "Back");
            back.OnClick             = this.GetType().GetMethod("backClick");
            back.OnClickInvokeObject = this;
            controls.Add(back);
        }
Example #11
0
        public override void Initialize()
        {
            title = new Elements.Label(5, 5, "Select field type");
            title.font = MineSweeper.contentManager.Load<SpriteFont>("Fonts/TitleFont");
            controls.Add(title);

            Elements.Button squareClassic = new Elements.Button(0, 45, 256, 40, "Rectangle");
            squareClassic.OnClick = this.GetType().GetMethod("scClick");
            squareClassic.OnClickInvokeObject = this;
            controls.Add(squareClassic);

            Elements.Button circle = new Elements.Button(0, 105, 256, 40, "Circle");
            circle.OnClick = this.GetType().GetMethod("cClick");
            circle.OnClickInvokeObject = this;
            controls.Add(circle);

            Elements.Button howToPlay = new Elements.Button(0, 205, 256, 40, "Controls");
            howToPlay.OnClick = this.GetType().GetMethod("htpClick");
            howToPlay.OnClickInvokeObject = this;
            controls.Add(howToPlay);
        }
Example #12
0
        public override void Initialize()
        {
            title      = new Elements.Label(5, 5, "Select field type");
            title.font = MineSweeper.contentManager.Load <SpriteFont>("Fonts/TitleFont");
            controls.Add(title);

            Elements.Button squareClassic = new Elements.Button(0, 45, 256, 40, "Rectangle");
            squareClassic.OnClick             = this.GetType().GetMethod("scClick");
            squareClassic.OnClickInvokeObject = this;
            controls.Add(squareClassic);

            Elements.Button circle = new Elements.Button(0, 105, 256, 40, "Circle");
            circle.OnClick             = this.GetType().GetMethod("cClick");
            circle.OnClickInvokeObject = this;
            controls.Add(circle);

            Elements.Button howToPlay = new Elements.Button(0, 205, 256, 40, "Controls");
            howToPlay.OnClick             = this.GetType().GetMethod("htpClick");
            howToPlay.OnClickInvokeObject = this;
            controls.Add(howToPlay);
        }