예제 #1
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);
        }
예제 #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);
        }