Example #1
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 #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()
        {
            ShouldBeScaled = false;
            ButtonsCount = FrameButtonsCount.Two;
            ShortUpperLine = true;

            saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35);
            saves.onElementSelected += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected);
            controls.Add(saves);

            lTitle = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Load Sandbox");
            lTitle.foreground = Color.White;
            controls.Add(lTitle);

            bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23,
                120, 23, "Delete");
            bdelete.Font = ButtonFont;
            bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick);
            controls.Add(bdelete);

            bload = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23,
                120, 23, "Load");
            bload.Font = ButtonFont;
            bload.onClicked += new Elements.Button.ClickedEventHandler(loadClick);
            controls.Add(bload);

            base.Initialize();
        }
Example #4
0
        public override void Initialize()
        {
            l            = new Elements.Label((int)Position.X + 30, (int)Position.Y + 30, "");
            l.font       = ResourceManager.Load <SpriteFont>("Fonts/LiberationSans_14");
            l.foreground = Color.White;
            controls.Add(l);

            l.text =
                "Developed\r\n" +
                "  -Glib Boytsun\r\n" +
                "Art by\r\n" +
                "  -Glib Boytsun\r\n" +
                "  -Stanislav Efremov\r\n" +
                "\r\n" +
                "Powered by:\r\n" +
                "  -Lua\r\n" +
                "  -LuaInterface\r\n" +
                "  -HTML Renderer\r\n" +
                "Full copyright notices can be found in Copyrights.txt file\r\n" +
                "\r\n" +
                "Music and sound effects from:\r\n" +
                "  http://www.looperman.com/loops/detail/65672\r\n" +
                "  http://www.looperman.com/loops/detail/51500\r\n" +
                "  http://freesound.org/people/Erokia/sounds/218854/\r\n" +
                "  http://freesound.org/people/junggle/sounds/26777/\r\n" +
                "  http://www.flashkit.com/soundfx/Electronic/Computers/High_Tec-NEO_Soun-8397/index.php"
            ;

            base.Initialize();
        }
Example #5
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 #6
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 #7
0
        public override void Initialize()
        {
            ShouldBeScaled = false;
            ButtonsCount   = FrameButtonsCount.Two;
            ShortUpperLine = true;

            saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35);
            saves.onElementSelected += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected);
            controls.Add(saves);

            lTitle            = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Load Sandbox");
            lTitle.foreground = Color.White;
            controls.Add(lTitle);

            bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23,
                                              120, 23, "Delete");
            bdelete.Font       = ButtonFont;
            bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick);
            controls.Add(bdelete);

            bload = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23,
                                            120, 23, "Load");
            bload.Font       = ButtonFont;
            bload.onClicked += new Elements.Button.ClickedEventHandler(loadClick);
            controls.Add(bload);

            base.Initialize();
        }
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, "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 #10
0
        public override void Initialize()
        {
            l = new Elements.Label((int)Position.X + 30, (int)Position.Y + 30, "");
            l.font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_14");
            l.foreground = Color.White;
            controls.Add(l);

            l.text =
                "Developed\r\n" +
                "  -Glib Boytsun\r\n" +
                "Art by\r\n" +
                "  -Glib Boytsun\r\n" +
                "  -Stanislav Efremov\r\n" +
                "\r\n" +
                "Powered by:\r\n" +
                "  -Lua\r\n" +
                "  -LuaInterface\r\n" +
                "  -HTML Renderer\r\n" +
                "Full copyright notices can be found in Copyrights.txt file\r\n" +
                "\r\n" +
                "Music and sound effects from:\r\n" +
                "  http://www.looperman.com/loops/detail/65672\r\n" +
                "  http://www.looperman.com/loops/detail/51500\r\n" +
                "  http://freesound.org/people/Erokia/sounds/218854/\r\n" +
                "  http://freesound.org/people/junggle/sounds/26777/\r\n" +
                "  http://www.flashkit.com/soundfx/Electronic/Computers/High_Tec-NEO_Soun-8397/index.php"
                ;

            base.Initialize();
        }
Example #11
0
        public new void Initialize()
        {
            ShouldBeScaled = false;

            #region ControlButtons
            sb = new Elements.EncyclopediaBrowserButton(540, 440, 120, 30, "Back");
            (sb as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            sb.foreground = Color.White;
            sb.onClicked += new Elements.Button.ClickedEventHandler(sbClick);
            //sb.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            controls.Add(sb);

            res = new Elements.EncyclopediaBrowserButton(670, 440, 120, 30, "Reset");
            (res as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            res.foreground = Color.White;
            res.onClicked += new Elements.Button.ClickedEventHandler(resClick);
            //res.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            controls.Add(res);
            #endregion

            for (int i = 0; i < l.Length; i++)
            {
                tl[i]            = new Elements.Label(10, 10 + i * 30, "");
                tl[i].font       = ResourceManager.Load <SpriteFont>("Fonts/LiberationSans_14");
                tl[i].foreground = Color.White;
                controls.Add(tl[i]);
            }
            tl[0].text = "Wires placed: ";
            tl[1].text = "Components placed: ";
            tl[2].text = "Times started: ";
            tl[3].text = "Components Removed: ";
            tl[4].text = "Wires burned: ";
            tl[5].text = "Buttons clicked: ";
            tl[6].text = "Text entered: ";
            tl[7].text = "Game start: ";

            int mw = 0;
            for (int i = 0; i < l.Length; i++)
            {
                if (tl[i].size.X > mw)
                {
                    mw = (int)tl[i].size.X;
                }
            }

            mw += 35;
            for (int i = 0; i < l.Length; i++)
            {
                l[i]            = new Elements.Label(mw, 10 + i * 30, "");
                l[i].font       = ResourceManager.Load <SpriteFont>("Fonts/LiberationSans_14");
                l[i].foreground = Color.White;
                controls.Add(l[i]);
            }

            base.Initialize();
            background = GUIEngine.s_mainMenu.background;
        }
Example #12
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 #13
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 #14
0
        public override void Initialize()
        {
            isVisible = true;
            Layer     = 800;

            l               = new Elements.Label(0, 0, text);
            l.font          = font;
            l.foreground    = Color.White;
            l.TextAlignment = Renderer.TextAlignment.Center;
            l.size          = size;
            controls.Add(l);

            base.Initialize();
        }
Example #15
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.One;

            #region ControlButtons

            res            = new Elements.MenuButton("Reset");
            res.Position   = new Vector2((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23);
            res.Size       = new Vector2(120, 23);
            res.Font       = ButtonFont;
            res.onClicked += new Elements.Button.ClickedEventHandler(resClick);
            controls.Add(res);
            #endregion

            for (int i = 0; i < l.Length; i++)
            {
                tl[i]            = new Elements.Label((int)Position.X + 10, (int)Position.Y + 10 + i * 40, "");
                tl[i].font       = ResourceManager.Load <SpriteFont>("Fonts/LiberationSans_14");
                tl[i].foreground = Color.White;
                controls.Add(tl[i]);
            }
            tl[0].text = "Wires placed: ";
            tl[1].text = "Components placed: ";
            tl[2].text = "Times started: ";
            tl[3].text = "Components Removed: ";
            tl[4].text = "Wires burned: ";
            tl[5].text = "Buttons clicked: ";
            tl[6].text = "Text entered: ";
            tl[7].text = "Game start: ";

            for (int i = 0; i < l.Length; i++)
            {
                if (tl[i].size.X > mw)
                {
                    mw = (int)tl[i].size.X;
                }
            }

            mw += 85;
            for (int i = 0; i < l.Length; i++)
            {
                l[i]            = new Elements.Label((int)Position.X + mw, (int)Position.Y + 10 + i * 40, "");
                l[i].font       = ResourceManager.Load <SpriteFont>("Fonts/LiberationSans_14");
                l[i].foreground = Color.White;
                controls.Add(l[i]);
            }

            base.Initialize();
        }
Example #16
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.One;

            #region ControlButtons

            res = new Elements.MenuButton("Reset");
            res.Position = new Vector2((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23);
            res.Size = new Vector2(120, 23);
            res.Font = ButtonFont;
            res.onClicked += new Elements.Button.ClickedEventHandler(resClick);
            controls.Add(res);
            #endregion

            for (int i = 0; i < l.Length; i++)
            {
                tl[i] = new Elements.Label((int)Position.X + 10, (int)Position.Y + 10 + i * 40, "");
                tl[i].font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_14");
                tl[i].foreground = Color.White;
                controls.Add(tl[i]);
            }
            tl[0].text = "Wires placed: ";
            tl[1].text = "Components placed: ";
            tl[2].text = "Times started: ";
            tl[3].text = "Components Removed: ";
            tl[4].text = "Wires burned: ";
            tl[5].text = "Buttons clicked: ";
            tl[6].text = "Text entered: ";
            tl[7].text = "Game start: ";

            for (int i = 0; i < l.Length; i++)
            {
                if (tl[i].size.X > mw) mw = (int)tl[i].size.X;
            }

            mw += 85;
            for (int i = 0; i < l.Length; i++)
            {
                l[i] = new Elements.Label((int)Position.X + mw, (int)Position.Y + 10 + i * 40, "");
                l[i].font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_14");
                l[i].foreground = Color.White;
                controls.Add(l[i]);
            }

            base.Initialize();
        }
Example #17
0
        public override void Initialize()
        {
            #region MasterVolume
            lmv            = new Elements.Label((int)Position.X + 5, (int)Position.Y + 15, "Master Volume");
            lmv.foreground = Color.White;
            controls.Add(lmv);

            mv = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 19, 200, 20);
            mv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mv_onValueChanged);
            mv.MinValue        = 0;
            mv.MaxValue        = 100;
            mv.Value           = (int)(Settings.MasterVolume * 100);
            controls.Add(mv);
            #endregion

            #region EffectVolume
            lev            = new Elements.Label((int)Position.X + 5, (int)Position.Y + 45, "Effects Volume");
            lev.foreground = Color.White;
            controls.Add(lev);

            ev = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 49, 200, 20);
            ev.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(ev_onValueChanged);
            ev.MinValue        = 0;
            ev.MaxValue        = 100;
            ev.Value           = (int)(Settings.EffectsVolume * 100);
            controls.Add(ev);
            #endregion

            #region MusicVolume
            lmzv            = new Elements.Label((int)Position.X + 5, (int)Position.Y + 75, "Music Volume");
            lmzv.foreground = Color.White;
            controls.Add(lmzv);

            mzv = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 79, 200, 20);
            mzv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mzv_onValueChanged);
            mzv.MinValue        = 0;
            mzv.MaxValue        = 100;
            mzv.Value           = (int)(Settings.MusicVolume * 100);
            controls.Add(mzv);
            #endregion

            base.Initialize();
        }
Example #18
0
        public override void Initialize()
        {
            #region MasterVolume
            lmv = new Elements.Label((int)Position.X + 5, (int)Position.Y + 15, "Master Volume");
            lmv.foreground = Color.White;
            controls.Add(lmv);

            mv = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 19, 200, 20);
            mv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mv_onValueChanged);
            mv.MinValue = 0;
            mv.MaxValue = 100;
            mv.Value = (int)(Settings.MasterVolume * 100);
            controls.Add(mv);
            #endregion

            #region EffectVolume
            lev = new Elements.Label((int)Position.X + 5, (int)Position.Y + 45, "Effects Volume");
            lev.foreground = Color.White;
            controls.Add(lev);

            ev = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 49, 200, 20);
            ev.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(ev_onValueChanged);
            ev.MinValue = 0;
            ev.MaxValue = 100;
            ev.Value = (int)(Settings.EffectsVolume * 100);
            controls.Add(ev);
            #endregion

            #region MusicVolume
            lmzv = new Elements.Label((int)Position.X + 5, (int)Position.Y + 75, "Music Volume");
            lmzv.foreground = Color.White;
            controls.Add(lmzv);

            mzv = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 79, 200, 20);
            mzv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mzv_onValueChanged);
            mzv.MinValue = 0;
            mzv.MaxValue = 100;
            mzv.Value = (int)(Settings.MusicVolume * 100);
            controls.Add(mzv);
            #endregion

            base.Initialize();
        }
Example #19
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 #20
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 #21
0
        public new void Initialize()
        {
            font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_18");
            ShouldBeScaled = false;
            Layer = 650;

            bok = new Elements.MenuButton(680, 0, 400, 30, "Got it!");
            bok.Font = font;
            bok.TextOffset = new Vector2(0, 3);
            bok.onClicked += new Elements.Button.ClickedEventHandler(bokClick);
            controls.Add(bok);

            lAvalable = new Elements.Label(0, 0, "Avalable components:");
            lAvalable.foreground = Color.White;
            controls.Add(lAvalable);

            lPurpose = new Elements.Label(0, 0, "Objective:");
            lPurpose.foreground = Color.White;
            controls.Add(lPurpose);

            base.Initialize();
        }
Example #22
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.One;

            article = new Encyclopedia.Article();
            article.position = Position + new Vector2(260, 23 + 96);
            article.Size = Size - new Vector2(260, 23 + 96) - new Vector2(26, 28);
            article.view.OnPageLoaded += new Elements.HTMLViewer.PageLoaded(view_OnPageLoaded);

            lFolder = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "");
            lFolder.foreground = Color.White;
            controls.Add(lFolder);

            sbFileList = new Elements.ScrollBar((int)Position.X + 278 - 7, (int)Position.Y + 100, 16, (int)Size.Y - 100 - 7);
            sbFileList.MaxValue = 10000;
            sbFileList.MinValue = 0;
            sbFileList.Value = 0;
            sbFileList.IsVertical = true;
            sbFileList.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbFileList_onValueChanged);
            controls.Add(sbFileList);

            sbArticle = new Elements.ScrollBar((int)(Position.X + Size.X) - 8, (int)Position.Y + 100, 16, (int)Size.Y - 89 - 100 - 7);
            sbArticle.MaxValue = 1;
            sbArticle.MinValue = 0;
            sbArticle.Value = 0;
            sbArticle.IsVertical = true;
            sbArticle.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbArticle_onValueChanged);
            controls.Add(sbArticle);

            goToLink = new Elements.MenuButton((int)(Position.X + Size.X - 120), (int)(Position.Y + Size.Y - 23), 120, 23, "Link");
            goToLink.isEnabled = false;
            goToLink.Font = ButtonFont;
            goToLink.onClicked += new Elements.Button.ClickedEventHandler(gotolink_onClicked);
            controls.Add(goToLink);

            base.Initialize();
        }
Example #23
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.Two;
            ShouldBeScaled = false;

            saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35);
            saves.onElementSelected += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected);
            saves.onSelectedIndexChanged += new Elements.SavesLoadsList.SelectionEvent(saves_onSelectedIndexChanged);
            controls.Add(saves);

            lTitle = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Save");
            lTitle.foreground = Color.White;
            controls.Add(lTitle);

            bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23,
                120, 23, "Delete");
            bdelete.Font = ButtonFont;
            bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick);
            controls.Add(bdelete);

            bsave = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23,
                120, 23, "Save");
            bsave.Font = ButtonFont;
            bsave.onClicked += new Elements.Button.ClickedEventHandler(saveClick);
            controls.Add(bsave);

            tb = new Elements.TextBox((int)saves.position.X, (int)bsave.position.Y, (int)saves.size.X, 23, "");
            tb.onTextChanged += new Elements.TextBox.TextChangedEventHandler(tb_onTextChanged);
            tb.BackgroundColor = Color.White * 0.2f;
            tb.ForegroundColor = Color.White;
            tb.CursorColor = Color.White;
            tb.Multiline = false;
            tb.BGAsColor = true;
            controls.Add(tb);

            base.Initialize();
        }
Example #24
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.One;

            article                    = new Encyclopedia.Article();
            article.position           = Position + new Vector2(260, 23 + 96);
            article.Size               = Size - new Vector2(260, 23 + 96) - new Vector2(26, 28);
            article.view.OnPageLoaded += new Elements.HTMLViewer.PageLoaded(view_OnPageLoaded);

            lFolder            = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "");
            lFolder.foreground = Color.White;
            controls.Add(lFolder);

            sbFileList                 = new Elements.ScrollBar((int)Position.X + 278 - 7, (int)Position.Y + 100, 16, (int)Size.Y - 100 - 7);
            sbFileList.MaxValue        = 10000;
            sbFileList.MinValue        = 0;
            sbFileList.Value           = 0;
            sbFileList.IsVertical      = true;
            sbFileList.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbFileList_onValueChanged);
            controls.Add(sbFileList);

            sbArticle                 = new Elements.ScrollBar((int)(Position.X + Size.X) - 8, (int)Position.Y + 100, 16, (int)Size.Y - 89 - 100 - 7);
            sbArticle.MaxValue        = 1;
            sbArticle.MinValue        = 0;
            sbArticle.Value           = 0;
            sbArticle.IsVertical      = true;
            sbArticle.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbArticle_onValueChanged);
            controls.Add(sbArticle);

            goToLink            = new Elements.MenuButton((int)(Position.X + Size.X - 120), (int)(Position.Y + Size.Y - 23), 120, 23, "Link");
            goToLink.isEnabled  = false;
            goToLink.Font       = ButtonFont;
            goToLink.onClicked += new Elements.Button.ClickedEventHandler(gotolink_onClicked);
            controls.Add(goToLink);

            base.Initialize();
        }
Example #25
0
        public override void Initialize()
        {
            ButtonsCount   = FrameButtonsCount.Two;
            ShouldBeScaled = false;

            saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35);
            saves.onElementSelected      += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected);
            saves.onSelectedIndexChanged += new Elements.SavesLoadsList.SelectionEvent(saves_onSelectedIndexChanged);
            controls.Add(saves);

            lTitle            = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Save");
            lTitle.foreground = Color.White;
            controls.Add(lTitle);

            bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23,
                                              120, 23, "Delete");
            bdelete.Font       = ButtonFont;
            bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick);
            controls.Add(bdelete);

            bsave = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23,
                                            120, 23, "Save");
            bsave.Font       = ButtonFont;
            bsave.onClicked += new Elements.Button.ClickedEventHandler(saveClick);
            controls.Add(bsave);

            tb = new Elements.TextBox((int)saves.position.X, (int)bsave.position.Y, (int)saves.size.X, 23, "");
            tb.onTextChanged  += new Elements.TextBox.TextChangedEventHandler(tb_onTextChanged);
            tb.BackgroundColor = Color.White * 0.2f;
            tb.ForegroundColor = Color.White;
            tb.CursorColor     = Color.White;
            tb.Multiline       = false;
            tb.BGAsColor       = true;
            controls.Add(tb);

            base.Initialize();
        }
Example #26
0
        public override void Initialize()
        {
            isVisible = true;
            Layer = 800;

            l = new Elements.Label(0, 0, text);
            l.font = font;
            l.foreground = Color.White;
            l.TextAlignment = Renderer.TextAlignment.Center;
            l.size = size;
            controls.Add(l);

            base.Initialize();
        }
Example #27
0
        public new void Initialize()
        {
            #region Basic
            Layer          = 100000;
            ShouldBeScaled = false;

            var a = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.GetEnumerator();
            a.MoveNext();
            maxw = a.Current.Width;
            maxh = a.Current.Height;
            a.MoveNext();
            while (true)//DO NOT TOUCH THIS CYCLE OR ELSE MONO GETS SCARED!!!
            {
                try
                {
                    if (a.Current == null)
                    {
                        break;
                    }
                }
                catch { System.Threading.Thread.Sleep(1); }
                try
                {
                    if (a.Current == null)
                    {
                        break;
                    }
                }
                catch { break; }
                try
                {
                    if (a.Current.Width > maxw)
                    {
                        maxw = a.Current.Width;
                    }
                    if (a.Current.Height > maxh)
                    {
                        maxh = a.Current.Height;
                    }
                }
                catch { }
                a.MoveNext();
            }
            #endregion

            #region ControlButtons
            sb = new Elements.EncyclopediaBrowserButton(410, 440, 120, 30, "Back");
            (sb as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            sb.foreground = Color.White;
            //sb.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            sb.onClicked += new Elements.Button.ClickedEventHandler(sbClick);
            controls.Add(sb);

            sac = new Elements.EncyclopediaBrowserButton(540, 440, 120, 30, "Save");
            (sac as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            sac.foreground = Color.White;
            //sac.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            sac.onClicked += new Elements.Button.ClickedEventHandler(sacClick);
            controls.Add(sac);

            ap = new Elements.EncyclopediaBrowserButton(670, 440, 120, 30, "Apply");
            (ap as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            ap.foreground = Color.White;
            //ap.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            ap.onClicked += new Elements.Button.ClickedEventHandler(apClick);
            controls.Add(ap);
            #endregion

            #region MasterVolume
            Elements.Label l1 = new Elements.Label(10, 20, "Master Volume");
            l1.foreground = Color.White;
            controls.Add(l1);

            mv = new Elements.ScrollBar(170, 24, 200, 20);
            mv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mv_onValueChanged);
            mv.MinValue        = 0;
            mv.MaxValue        = 100;
            mv.Value           = (int)(Settings.MasterVolume * 100);
            controls.Add(mv);
            #endregion

            #region EffectVolume
            Elements.Label l11 = new Elements.Label(10, 50, "Effects Volume");
            l11.foreground = Color.White;
            controls.Add(l11);

            ev = new Elements.ScrollBar(170, 54, 200, 20);
            ev.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(ev_onValueChanged);
            ev.MinValue        = 0;
            ev.MaxValue        = 100;
            ev.Value           = (int)(Settings.EffectsVolume * 100);
            controls.Add(ev);
            #endregion

            #region MusicVolume
            Elements.Label l111 = new Elements.Label(10, 80, "Music Volume");
            l111.foreground = Color.White;
            controls.Add(l111);

            mzv = new Elements.ScrollBar(170, 84, 200, 20);
            mzv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mzv_onValueChanged);
            mzv.MinValue        = 0;
            mzv.MaxValue        = 100;
            mzv.Value           = (int)(Settings.MusicVolume * 100);
            controls.Add(mzv);
            #endregion

            #region Resoulutions
            lar            = new Elements.Label(400, 20, "Aspect ratio:");
            lar.foreground = Color.White;
            controls.Add(lar);

            ar = new Elements.ComboBox(550, 22, 120, 24);
            ar.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(ar_onElementSelected);
            controls.Add(ar);
            ar.ItemsAdd("4*3");
            ar.ItemsAdd("5*3");
            if (maxw >= 1280 && maxh >= 720)
            {
                ar.ItemsAdd("16*9");
            }
            if (maxw >= 1280 && maxh >= 800)
            {
                ar.ItemsAdd("16*10");
            }

            lres            = new Elements.Label(400, 50, "Resolution:");
            lres.foreground = Color.White;
            controls.Add(lres);

            res = new Elements.ComboBox(550, 52, 120, 24);
            res.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(res_onElementSelected);
            controls.Add(res);

            fs            = new Elements.CheckBox(400, 90, 170, 20, "FullScreen", false);
            fs.foreground = Color.White;
            controls.Add(fs);
            #endregion

            #region Hotkeys
            hcSimStart = new Elements.HotkeyControl(5, 125, 250, "Simulation start", Settings.k_SimulationStart);
            controls.Add(hcSimStart);
            hcSimStop = new Elements.HotkeyControl(5, 150, 250, "Simulation stop", Settings.k_SimulationStop);
            controls.Add(hcSimStop);
            hcSimPause = new Elements.HotkeyControl(5, 175, 250, "Simulation pause", Settings.k_SimulationPause);
            controls.Add(hcSimPause);
            hcUndo = new Elements.HotkeyControl(5, 200, 250, "Undo", Settings.k_Undo);
            controls.Add(hcUndo);
            hcCompRem = new Elements.HotkeyControl(5, 250, 250, "Remove single component", Settings.k_ComponentRemove);
            controls.Add(hcCompRem);
            hcEraser = new Elements.HotkeyControl(5, 275, 250, "Eraser", Settings.k_Eraser);
            controls.Add(hcEraser);
            hcZoomIn = new Elements.HotkeyControl(5, 300, 250, "Zoom In", Settings.k_ZoomIn);
            controls.Add(hcZoomIn);
            hcZoomOut = new Elements.HotkeyControl(5, 325, 250, "Zoom Out", Settings.k_ZoomOut);
            controls.Add(hcZoomOut);
            #endregion

            base.Initialize();
            background = GUIEngine.s_mainMenu.background;
        }
Example #28
0
        public new void Initialize()
        {
            font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_18");
            ShouldBeScaled = false;
            Layer = 650;

            bok = new Elements.MenuButton(680, 0, 400, 30, "Got it!");
            bok.Font = font;
            bok.TextOffset = new Vector2(0, 3);
            bok.onClicked += new Elements.Button.ClickedEventHandler(bokClick);
            controls.Add(bok);

            lAvalable = new Elements.Label(0, 0, "Avalable components:");
            lAvalable.foreground = Color.White;
            controls.Add(lAvalable);

            lPurpose = new Elements.Label(0, 0, "Objective:");
            lPurpose.foreground = Color.White;
            controls.Add(lPurpose);

            base.Initialize();
        }
Example #29
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.One;

            #region MaxRes
            var a = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.GetEnumerator();
            a.MoveNext();
            maxw = a.Current.Width;
            maxh = a.Current.Height;
            a.MoveNext();
            while (true)//DO NOT TOUCH THIS CYCLE OR ELSE MONO GETS SCARED!!!
            {
                try
                {
                    if (a.Current == null)
                        break;
                }
                catch { System.Threading.Thread.Sleep(1); }
                try
                {
                    if (a.Current == null)
                        break;
                }
                catch { break; }
                try
                {
                    if (a.Current.Width > maxw) maxw = a.Current.Width;
                    if (a.Current.Height > maxh) maxh = a.Current.Height;
                }
                catch { }
                a.MoveNext();
            }
            #endregion

            #region Resoulutions
            l_aspectRatio = new Elements.Label((int)Position.X + 5, (int)Position.Y + 5, "Aspect ratio:");
            l_aspectRatio.foreground = Color.White;
            controls.Add(l_aspectRatio);

            co_aspectRation = new Elements.ComboBox((int)Position.X + 150, (int)Position.Y + 7, 120, 24);
            co_aspectRation.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(ar_onElementSelected);
            controls.Add(co_aspectRation);
            co_aspectRation.ItemsAdd("4*3");
            co_aspectRation.ItemsAdd("5*3");
            if (maxw >= 1280 && maxh >= 720) co_aspectRation.ItemsAdd("16*9");
            if (maxw >= 1280 && maxh >= 800) co_aspectRation.ItemsAdd("16*10");

            l_resolution = new Elements.Label((int)Position.X + 5, (int)Position.Y + 35, "Resolution:");
            l_resolution.foreground = Color.White;
            controls.Add(l_resolution);

            co_resolution = new Elements.ComboBox((int)Position.X + 150, (int)Position.Y + 37, 120, 24);
            co_resolution.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(res_onElementSelected);
            controls.Add(co_resolution);

            cb_fullscreen = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 65, 200, 20, "FullScreen", false);
            cb_fullscreen.foreground = Color.White;
            cb_fullscreen.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_fullscreen_onCheckedChanged);
            controls.Add(cb_fullscreen);

            b_apply = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23,
                "Apply");
            b_apply.Font = ButtonFont;
            b_apply.onClicked += new Elements.Button.ClickedEventHandler(apply_onClicked);
            controls.Add(b_apply);
            #endregion

            cb_drawgrig = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 95, 200, 20, "Draw grid", false);
            cb_drawgrig.foreground = Color.White;
            cb_drawgrig.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_drawgrig_onCheckedChanged);
            controls.Add(cb_drawgrig);

            cb_warning = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 125, 200, 20, "Show intro warning", false);
            cb_warning.foreground = Color.White;
            cb_warning.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_warning_onCheckedChanged);
            controls.Add(cb_warning);

            base.Initialize();
        }
Example #30
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.One;

            #region MaxRes
            var a = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.GetEnumerator();
            a.MoveNext();
            maxw = a.Current.Width;
            maxh = a.Current.Height;
            a.MoveNext();
            while (true)//DO NOT TOUCH THIS CYCLE OR ELSE MONO GETS SCARED!!!
            {
                try
                {
                    if (a.Current == null)
                    {
                        break;
                    }
                }
                catch { System.Threading.Thread.Sleep(1); }
                try
                {
                    if (a.Current == null)
                    {
                        break;
                    }
                }
                catch { break; }
                try
                {
                    if (a.Current.Width > maxw)
                    {
                        maxw = a.Current.Width;
                    }
                    if (a.Current.Height > maxh)
                    {
                        maxh = a.Current.Height;
                    }
                }
                catch { }
                a.MoveNext();
            }
            #endregion

            #region Resoulutions
            l_aspectRatio            = new Elements.Label((int)Position.X + 5, (int)Position.Y + 5, "Aspect ratio:");
            l_aspectRatio.foreground = Color.White;
            controls.Add(l_aspectRatio);

            co_aspectRation = new Elements.ComboBox((int)Position.X + 150, (int)Position.Y + 7, 120, 24);
            co_aspectRation.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(ar_onElementSelected);
            controls.Add(co_aspectRation);
            co_aspectRation.ItemsAdd("4*3");
            co_aspectRation.ItemsAdd("5*3");
            if (maxw >= 1280 && maxh >= 720)
            {
                co_aspectRation.ItemsAdd("16*9");
            }
            if (maxw >= 1280 && maxh >= 800)
            {
                co_aspectRation.ItemsAdd("16*10");
            }

            l_resolution            = new Elements.Label((int)Position.X + 5, (int)Position.Y + 35, "Resolution:");
            l_resolution.foreground = Color.White;
            controls.Add(l_resolution);

            co_resolution = new Elements.ComboBox((int)Position.X + 150, (int)Position.Y + 37, 120, 24);
            co_resolution.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(res_onElementSelected);
            controls.Add(co_resolution);

            cb_fullscreen                   = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 65, 200, 20, "FullScreen", false);
            cb_fullscreen.foreground        = Color.White;
            cb_fullscreen.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_fullscreen_onCheckedChanged);
            controls.Add(cb_fullscreen);

            b_apply = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23, 120, 23,
                                              "Apply");
            b_apply.Font       = ButtonFont;
            b_apply.onClicked += new Elements.Button.ClickedEventHandler(apply_onClicked);
            controls.Add(b_apply);
            #endregion

            cb_drawgrig                   = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 95, 200, 20, "Draw grid", false);
            cb_drawgrig.foreground        = Color.White;
            cb_drawgrig.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_drawgrig_onCheckedChanged);
            controls.Add(cb_drawgrig);

            cb_warning                   = new Elements.CheckBox((int)Position.X + 5, (int)Position.Y + 125, 200, 20, "Show intro warning", false);
            cb_warning.foreground        = Color.White;
            cb_warning.onCheckedChanged += new Elements.CheckBox.CheckBoxCheckedHandler(cb_warning_onCheckedChanged);
            controls.Add(cb_warning);

            base.Initialize();
        }
Example #31
0
        public new void Initialize()
        {
            #region Basic
            Layer = 100000;
            ShouldBeScaled = false;

            var a = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.GetEnumerator();
            a.MoveNext();
            maxw = a.Current.Width;
            maxh = a.Current.Height;
            a.MoveNext();
            while (true)//DO NOT TOUCH THIS CYCLE OR ELSE MONO GETS SCARED!!!
            {
                try
                {
                    if (a.Current == null)
                        break;
                }
                catch { System.Threading.Thread.Sleep(1); }
                try
                {
                    if (a.Current == null)
                        break;
                }
                catch { break; }
                try
                {
                    if (a.Current.Width > maxw) maxw = a.Current.Width;
                    if (a.Current.Height > maxh) maxh = a.Current.Height;
                }
                catch { }
                a.MoveNext();
            }
            #endregion

            #region ControlButtons
            sb = new Elements.EncyclopediaBrowserButton(410, 440, 120, 30, "Back");
            (sb as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            sb.foreground = Color.White;
            //sb.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            sb.onClicked +=new Elements.Button.ClickedEventHandler(sbClick);
            controls.Add(sb);

            sac = new Elements.EncyclopediaBrowserButton(540, 440, 120, 30, "Save");
            (sac as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            sac.foreground = Color.White;
            //sac.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            sac.onClicked += new Elements.Button.ClickedEventHandler(sacClick);
            controls.Add(sac);

            ap = new Elements.EncyclopediaBrowserButton(670, 440, 120, 30, "Apply");
            (ap as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            ap.foreground = Color.White;
            //ap.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            ap.onClicked += new Elements.Button.ClickedEventHandler(apClick);
            controls.Add(ap);
            #endregion

            #region MasterVolume
            Elements.Label l1 = new Elements.Label(10, 20, "Master Volume");
            l1.foreground = Color.White;
            controls.Add(l1);

            mv = new Elements.ScrollBar(170, 24, 200, 20);
            mv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mv_onValueChanged);
            mv.MinValue = 0;
            mv.MaxValue = 100;
            mv.Value = (int)(Settings.MasterVolume * 100);
            controls.Add(mv);
            #endregion

            #region EffectVolume
            Elements.Label l11 = new Elements.Label(10, 50, "Effects Volume");
            l11.foreground = Color.White;
            controls.Add(l11);

            ev = new Elements.ScrollBar(170, 54, 200, 20);
            ev.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(ev_onValueChanged);
            ev.MinValue = 0;
            ev.MaxValue = 100;
            ev.Value = (int)(Settings.EffectsVolume * 100);
            controls.Add(ev);
            #endregion

            #region MusicVolume
            Elements.Label l111 = new Elements.Label(10, 80, "Music Volume");
            l111.foreground = Color.White;
            controls.Add(l111);

            mzv = new Elements.ScrollBar(170, 84, 200, 20);
            mzv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mzv_onValueChanged);
            mzv.MinValue = 0;
            mzv.MaxValue = 100;
            mzv.Value = (int)(Settings.MusicVolume * 100);
            controls.Add(mzv);
            #endregion

            #region Resoulutions
            lar = new Elements.Label(400, 20, "Aspect ratio:");
            lar.foreground = Color.White;
            controls.Add(lar);

            ar = new Elements.ComboBox(550, 22, 120, 24);
            ar.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(ar_onElementSelected);
            controls.Add(ar);
            ar.ItemsAdd("4*3");
            ar.ItemsAdd("5*3");
            if (maxw >= 1280 && maxh >= 720) ar.ItemsAdd("16*9");
            if (maxw >= 1280 && maxh >= 800) ar.ItemsAdd("16*10");

            lres = new Elements.Label(400, 50, "Resolution:");
            lres.foreground = Color.White;
            controls.Add(lres);

            res = new Elements.ComboBox(550, 52, 120, 24);
            res.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(res_onElementSelected);
            controls.Add(res);

            fs = new Elements.CheckBox(400, 90, 170, 20, "FullScreen", false);
            fs.foreground = Color.White;
            controls.Add(fs);
            #endregion

            #region Hotkeys
            hcSimStart = new Elements.HotkeyControl(5, 125, 250, "Simulation start", Settings.k_SimulationStart);
            controls.Add(hcSimStart);
            hcSimStop = new Elements.HotkeyControl(5, 150, 250,  "Simulation stop", Settings.k_SimulationStop);
            controls.Add(hcSimStop);
            hcSimPause = new Elements.HotkeyControl(5, 175, 250, "Simulation pause", Settings.k_SimulationPause);
            controls.Add(hcSimPause);
            hcUndo = new Elements.HotkeyControl(5,    200, 250, "Undo", Settings.k_Undo);
            controls.Add(hcUndo);
            hcCompRem = new Elements.HotkeyControl(5, 250, 250, "Remove single component", Settings.k_ComponentRemove);
            controls.Add(hcCompRem);
            hcEraser = new Elements.HotkeyControl(5, 275, 250, "Eraser", Settings.k_Eraser);
            controls.Add(hcEraser);
            hcZoomIn = new Elements.HotkeyControl(5, 300, 250, "Zoom In", Settings.k_ZoomIn);
            controls.Add(hcZoomIn);
            hcZoomOut = new Elements.HotkeyControl(5, 325, 250, "Zoom Out", Settings.k_ZoomOut);
            controls.Add(hcZoomOut);
            #endregion

            base.Initialize();
            background = GUIEngine.s_mainMenu.background;
        }
Example #32
0
        public new void Initialize()
        {
            ShouldBeScaled = false;

            #region ControlButtons
            sb = new Elements.EncyclopediaBrowserButton(540, 440, 120, 30, "Back");
            (sb as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            sb.foreground = Color.White;
            sb.onClicked += new Elements.Button.ClickedEventHandler(sbClick);
            //sb.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            controls.Add(sb);

            res = new Elements.EncyclopediaBrowserButton(670, 440, 120, 30, "Reset");
            (res as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            res.foreground = Color.White;
            res.onClicked += new Elements.Button.ClickedEventHandler(resClick);
            //res.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            controls.Add(res);
            #endregion

            for (int i = 0; i < l.Length; i++)
            {
                tl[i] = new Elements.Label(10, 10 + i * 30, "");
                tl[i].font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_14");
                tl[i].foreground = Color.White;
                controls.Add(tl[i]);
            }
            tl[0].text = "Wires placed: ";
            tl[1].text = "Components placed: ";
            tl[2].text = "Times started: ";
            tl[3].text = "Components Removed: ";
            tl[4].text = "Wires burned: ";
            tl[5].text = "Buttons clicked: ";
            tl[6].text = "Text entered: ";
            tl[7].text = "Game start: ";

            int mw = 0;
            for (int i = 0; i < l.Length; i++)
            {
                if (tl[i].size.X > mw) mw = (int)tl[i].size.X;
            }

            mw += 35;
            for (int i = 0; i < l.Length; i++)
            {
                l[i] = new Elements.Label(mw, 10 + i * 30, "");
                l[i].font = ResourceManager.Load<SpriteFont>("Fonts/LiberationSans_14");
                l[i].foreground = Color.White;
                controls.Add(l[i]);
            }

            base.Initialize();
            background = GUIEngine.s_mainMenu.background;
        }