예제 #1
0
        public override void Init(Game1 game)
        {
            Color = Color.White;

            var skin = new Skin(game.GreyImageMap, game.GreyMap);
            var text = new Text(game.GreySpriteFont, Color.Black);

            //Simply subscribe to the events demonstrated below
            _gui = new Gui(game, skin, text);
            _gui.CharEntered += CharEntered;
            _gui.KeyDown += KeyDown;
            _gui.KeyUp += KeyUp;
            _gui.MouseDoubleClick += MouseDoubleClick;
            _gui.MouseDown += MouseDown;
            _gui.MouseHover += MouseHover;
            _gui.MouseUp += MouseUp;
            _gui.MouseWheel += MouseWheel;

            _gui.AddWidget(_hasMouse = new Label(100, 10 + 30 * 0, "Test1"));
            _gui.AddWidget(_charEntered = new Label(100, 10 + 30 * 1, "Test2"));
            _gui.AddWidget(_keyDown = new Label(100, 10 + 30 * 2, "Test3"));
            _gui.AddWidget(_keyUp = new Label(100, 10 + 30 * 3, "Test3"));
            _gui.AddWidget(_doubleClick = new Label(100, 10 + 30 * 4, "Test4"));
            _gui.AddWidget(_mouseDown = new Label(100, 10 + 30 * 5, "Test5"));
            _gui.AddWidget(_mouseHover = new Label(100, 10 + 30 * 6, "Test6"));
            _gui.AddWidget(_mouseUp = new Label(100, 10 + 30 * 7, "Test7"));
            _gui.AddWidget(_mouseWheel = new Label(100, 10 + 30 * 8, "Test7"));
        }
예제 #2
0
파일: Gui.cs 프로젝트: yadiate/MonoGameGui
        /*####################################################################*/
        /*                           Initialization                           */
        /*####################################################################*/
        public Gui(Game game, Skin defaultSkin, Text defaultText,
            IEnumerable<Tuple<string, Skin>> skins = null, 
            IEnumerable<Tuple<string, Text>> textRenderers = null)
        {
            InitDom();

            NewState = OldState = new MouseState();

            InputManager = new InputManager(Dom);
            RenderManager = new RenderManager(game.GraphicsDevice);

            SetDefaultSettings(game, defaultSkin, defaultText);

            if (skins != null) {
                foreach (var skin in skins) {
                    AddSkin(skin.Item1, skin.Item2);
                }
            }

            if (textRenderers != null) {
                foreach (var textRenderer in textRenderers) {
                    AddText(textRenderer.Item1, textRenderer.Item2);
                }
            }
        }
예제 #3
0
 public override void Load()
 {
     if (Skin == null) { Skin = DefaultSkin; }
     if (Text == null) { Text = DefaultText; }
     TextRenderer = RenderManager.Texts[Text];
     LoadRenderers();
     Loaded = true;
 }
예제 #4
0
        public override void Init(Game1 game)
        {
            Color = Color.White;

            var beaker = game.Content.Load<Texture2D>("beaker");

            var skin = new Skin(game.GreyImageMap, game.GreyMap);
            var text = new Text(game.GreySpriteFont, Color.Black);

            var testSkin = new Skin(game.TestImageMap, game.TestMap);
            var testText = new Text(game.TestSpriteFont, Color.Black);

            var testSkins = new[] { new Tuple<string, Skin>("testSkin", testSkin) };
            var testTexts = new[] { new Tuple<string, Text>("testText", testText) };

            _gui = new Gui(game, skin, text, testSkins, testTexts)
            {

                Widgets = new Widget[] {
                    //By default the Button is as wide as the width of the label plus the edge of the button graphic
                    new Button(10, BUTTON_DISPLACEMENT_Y + (40 * 0), "Start Game", buttonEvent: delegate(Widget widget) {
                        buttonPressed = 1;
                    }) { Skin = "testSkin", Text = "testText" },
                    new Button(10, BUTTON_DISPLACEMENT_Y + (40 * 1), "Options", buttonEvent: delegate(Widget widget) {
                        buttonPressed = 2;
                    }) { Skin = "testSkin", Text = "testText" },
                    new Button(10, BUTTON_DISPLACEMENT_Y + (40 * 2), "Instructions", buttonEvent: delegate(Widget widget) {
                        buttonPressed = 3;
                    }) { Skin = "testSkin", Text = "testText" },
                    new Button(10, BUTTON_DISPLACEMENT_Y + (40 * 3), "Credits", buttonEvent: delegate(Widget widget) {
                        buttonPressed = 4;
                    }) { Skin = "testSkin", Text = "testText" },
                    new Button(10, BUTTON_DISPLACEMENT_Y + (40 * 4), "Exit", buttonEvent: delegate(Widget widget) {
                        buttonPressed = 5;
                    }) { Skin = "testSkin", Text = "testText" },
                    new Button(10, BUTTON_DISPLACEMENT_Y + (40 * 5), "Back", buttonEvent: delegate(Widget widget) {
                        buttonPressed = 6;
                    }) { Skin = "testSkin", Text = "testText", Visible = false },

                    new Label(LABEL_DISPLACEMENT_X, LABEL_DISPLACEMENT_Y + (40 * 0), "Time"){Visible = false},
                    new Label(LABEL_DISPLACEMENT_X, LABEL_DISPLACEMENT_Y + (40 * 1), "Rounds"){Visible = false},
                    new Label(LABEL_DISPLACEMENT_X, LABEL_DISPLACEMENT_Y + (40 * 2), "Players"){Visible = false},

                    new SingleLineTextBox(TEXTBOX_DISPLACEMENT_X, TEXTBOX_DISPLACEMENT_Y + (40 * 0), TEXTBOX_WIDTH, TEXTBOX_HEIGHT){Visible = false},
                    new SingleLineTextBox(TEXTBOX_DISPLACEMENT_X, TEXTBOX_DISPLACEMENT_Y + (40 * 1), TEXTBOX_WIDTH, TEXTBOX_HEIGHT){Visible = false},
                    new SingleLineTextBox(TEXTBOX_DISPLACEMENT_X, TEXTBOX_DISPLACEMENT_Y + (40 * 2), TEXTBOX_WIDTH, TEXTBOX_HEIGHT){Visible = false},
                }
            };
        }
예제 #5
0
        public override void Init(Game1 game)
        {
            Color = Color.White;

            var skin = new Skin(game.GreyImageMap, game.GreyMap);
            var text = new Text(game.GreySpriteFont, Color.Black);

            var testSkin = new Skin(game.TestImageMap, game.TestMap);
            var testText = new Text(game.TestSpriteFont, Color.Black);

            var testSkins = new[] { new Tuple<string, Skin>("testSkin", testSkin) };
            var testTexts = new[] { new Tuple<string, Text>("testText", testText) };

            _gui = new Gui(game, skin, text, testSkins, testTexts) {
                Widgets = new Widget[] {

                    new Button(10, 10 + (40 * 0), "Button"),
                    new Button(10, 10 + (40 * 1), "Skin") { Skin = "testSkin", Text = "testText" },

                    new Button(10, 10 + (40 * 2), "Change Label", buttonEvent: delegate(Widget widget) {
                        ((Button)widget).Label = _label.Value;
                    }),
                    _label = new SingleLineTextBox(220, 10 + (40 * 2), 100, 10),

                    new Button(10, 10 + (40 * 4), "TextPadding = 25", 25),
                    new Button(10, 10 + (40 * 5), "TextPadding = 25") { TextPadding = 25 },
                    new Button(10, 10 + (40 * 6), "Change TextPadding", buttonEvent: delegate(Widget widget) {
                        int value;
                        if (int.TryParse(_padding.Value, out value)) {
                            ((Button)widget).TextPadding = value;
                        }
                    }),
                    _padding = new SingleLineTextBox(220, 10 + (40 * 6), 100, 10),

                    new Button(10, 10 + (40 * 8), 200, "Width = 200"),
                    new Button(10, 10 + (40 * 9), "Width = 200") { Width = 200 },
                    new Button(10, 10 + (40 * 10), "Change Width", buttonEvent: delegate(Widget widget) {
                        int value;
                        if (int.TryParse(_width.Value, out value)) {
                            ((Button)widget).Width = value;
                        }
                    }),
                    _width = new SingleLineTextBox(220, 10 + (40 * 10), 100, 10)

                }
            };
        }
예제 #6
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Texture2D GreyImageMap = Content.Load<Texture2D>(@"GUI\ImageMap");
            string GreyMap = File.OpenText(@"Content\GUI\Map.txt").ReadToEnd();
            Font = Content.Load<SpriteFont>(@"Minecraftia");

            DefaultSkin = new Skin(GreyImageMap, GreyMap);
            DefaultText = new Text(Font, Color.White);
        }
예제 #7
0
        private void SetDefaultSettings(Game.Game1 game, Skin defaultSkin, Text defaultText)
        {
            DefaultScrollSpeed = 3;
            DefaultWheelSpeed = 6;

            SelectionColor = new Texture2D(game.GraphicsDevice, 1, 1);
            HighlightingColor = Color.LightSkyBlue * 0.3f;

            AddSkin("Default", defaultSkin);
            DefaultSkin = "Default";

            AddText("Default", defaultText);
            DefaultText = "Default";
        }
예제 #8
0
 public void AddText(string name, Text renderer)
 {
     RenderManager.AddText(name, renderer);
 }
예제 #9
0
        public override void Init(Game1 game)
        {
            Color = Color.White;

            _beaker = game.Content.Load<Texture2D>("beaker");

            var skin = new Skin(game.GreyImageMap, game.GreyMap);
            var text = new Text(game.GreySpriteFont, Color.LightGray);

            _gui = new Gui(game, skin, text) {
                Widgets = new Widget[] {
                    new ScrollBars {
                        Children = new Widget[] {
                            new Panel(10, 10, 1000, 1000) {
                                Children = new Widget[] {
                                    new ScrollBars {
                                        Children = new Widget[] {
                                            new Button(10, 10, "Test 1"),
                                            new Button(10, 50, "Test 2"),
                                            new Button(10, 90, "Test 3"),
                                            new Button(10, 130, "Test 4"),
                                            new Button(10, 170, "Test 5"),
                                            new Button(10, 210, "Test 6"),
                                            new Button(10, 250, "Test 7"),
                                            new Button(10, 290, "Test 8"),
                                            new Button(10, 330, "Test 9"),
                                            new Button(10, 370, "Test 10"),
                                            new Button(10, 410, "Test 11"),
                                            new Button(10, 450, "Test 12"),
                                            new Button(10, 490, "Test 13"),
                                            new Button(10, 530, "Test 14"),
                                            new Button(10, 570, "Test 15"),
                                            new Button(10, 610, "Test 16"),
                                            new Panel(100, 10, 200, 200) {
                                                Children = new Widget[] {
                                                    new Button(10, 10, "Test 1"),
                                                    new Button(10, 50, "Test 2"),
                                                    new Button(10, 90, "Test 3")
                                                }
                                            },
                                            new Panel(100, 230, 400, 400) {
                                                Children = new Widget[] {
                                                    new ScrollBars {
                                                        Children = new Widget[] {
                                                            new Button(10, 10, "Test 1"),
                                                            new Button(10, 50, "Test 2"),
                                                            new Button(10, 90, "Test 3"),
                                                            new Button(10, 130, "Test 4"),
                                                            new Button(10, 170, "Test 5"),
                                                            new Button(10, 210, "Test 6"),
                                                            new Button(10, 250, "Test 7"),
                                                            new Button(10, 290, "Test 8"),
                                                            new Button(10, 330, "Test 9"),
                                                            new Button(10, 370, "Test 10"),
                                                            new Button(10, 410, "Test 11"),
                                                            new Button(10, 450, "Test 12"),
                                                            new Button(10, 490, "Test 13"),
                                                            new Button(10, 530, "Test 14"),
                                                            new Button(10, 570, "Test 15"),
                                                            new Button(10, 610, "Test 16"),
                                                            new Panel(100, 10, 600, 600) {
                                                                Children = new Widget[] {
                                                                    new ScrollBars {
                                                                        Children = new Widget[] {
                                                                            new Button(10, 10, "Button"),
                                                                            new ToggleButton(10, 50, "Toggle Button"),
                                                                            new Panel(10, 90, 120, 120),
                                                                            new CheckBox(10, 215, "Check Box"),
                                                                            new RadioButton(10, 255, "GRP", "Radio 1"),
                                                                            new RadioButton(10, 285, "GRP", "Radio 2"),
                                                                            new RadioButton(10, 315, "GRP", "Radio 3"),
                                                                            new Label(10, 340, "Research"),
                                                                            new Label(10, 365, _beaker, "Research"),
                                                                            new Panel(140, 90, 220, 220) {
                                                                                Children = new Widget[] {
                                                                                    new TextBox(2, 600)
                                                                                }
                                                                            },
                                                                            new Panel(370, 70, 220, 220) {
                                                                                Children = new Widget[] {
                                                                                    new ScrollBars {
                                                                                        Children = new Widget[] {
                                                                                            new CheckBox(10, 10, "Button"),
                                                                                            new CheckBox(210, 10, "Button"),
                                                                                            new CheckBox(10, 210, "Button"),
                                                                                            new CheckBox(210, 210, "Button"),
                                                                                            new Panel(10, 230, 300, 300) {
                                                                                                Children = new Widget[] {
                                                                                                    new TextBox(2, 300)
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };
        }
예제 #10
0
        protected override void LoadRenderers()
        {
            _default = LoadRenderer<SlidingDoorRenderer>(Skin, "button");
            _hover = LoadRenderer<SlidingDoorRenderer>(Skin, "button_hover");
            _pressed = LoadRenderer<SlidingDoorRenderer>(Skin, "button_pushed");

            switch (OpenDirection) {
                case CardinalDirection.North: {
                    _dropDownDark = LoadRenderer<SlidingDoorRenderer>(Skin, "dark_drop_down_inverted");
                    _dropDownLight = LoadRenderer<SlidingDoorRenderer>(Skin, "light_drop_down_inverted");
                    _dropDownHover = LoadRenderer<SlidingDoorRenderer>(Skin, "hover_drop_down_inverted");
                    break;
                } case CardinalDirection.South: {
                    _dropDownDark = LoadRenderer<SlidingDoorRenderer>(Skin, "dark_drop_down");
                    _dropDownLight = LoadRenderer<SlidingDoorRenderer>(Skin, "light_drop_down");
                    _dropDownHover = LoadRenderer<SlidingDoorRenderer>(Skin, "hover_drop_down");
                    break;
                }
            }

            _dropDownRender = LoadRenderer<IconRenderer>(Skin, "drop_down");

            _textRenderer = RenderManager.Texts[RenderManager.DefaultText];
        }
예제 #11
0
        protected override void LoadRenderers()
        {
            _default = LoadRenderer<SlidingDoorRenderer>(Skin, "button");
            _hover = LoadRenderer<SlidingDoorRenderer>(Skin, "button_hover");
            _pressed = LoadRenderer<SlidingDoorRenderer>(Skin, "button_pushed");

            _textRenderer = RenderManager.Texts[Text];
        }
예제 #12
0
 internal void AddText(string name, Text textRenderer)
 {
     Texts.Add(name, textRenderer);
 }
        public override void Init(Game1 game)
        {
            Color = Color.White;

            var beaker = game.Content.Load<Texture2D>("beaker");

            var skin = new Skin(game.GreyImageMap, game.GreyMap);
            var text = new Text(game.GreySpriteFont, Color.Black);

            var testSkin = new Skin(game.TestImageMap, game.TestMap);
            var testText = new Text(game.TestSpriteFont, Color.Black);

            var testSkins = new[] { new Tuple<string, Skin>("testSkin", testSkin) };
            var testTexts = new[] { new Tuple<string, Text>("testText", testText) };

            _gui = new Gui(game, skin, text, testSkins, testTexts) {
                Widgets = new Widget[] {
                    //By default the Button is as wide as the width of the label plus the edge of the button graphic
                    new Button(10, 10 + (40 * 0), "Button") { Skin = "testSkin", Text = "testText" },
                    new Button(10, 10 + (40 * 1), "Wide Button"),
                    new Button(10, 10 + (40 * 2), "T"),
                    new Button(10, 10 + (40 * 3), 120, "Width 120"),
                    //Button will resized to fit if the specified width is smaller than the width of the text
                    new Button(10, 10 + (40 * 4), 20, "Width 20"),
                    //The optional padding argument causes the button to be as wide as the label + (padding * 2)
                    new Button(10, 10 + (40 * 5), "5 Padding", 5),
                    new Button(10, 10 + (40 * 6), "10 Padding", 10),

                    //The ToggleButton behaves similarly to the Button but toggles between being
                    //pressed or released each time its clicked.
                    new ToggleButton(150, 10 + (40 * 0), "Button"),
                    new ToggleButton(150, 10 + (40 * 1), "Wide Button"),
                    new ToggleButton(150, 10 + (40 * 2), "T"),
                    new ToggleButton(150, 10 + (40 * 3), 120, "Width 120"),
                    new ToggleButton(150, 10 + (40 * 4), 20, "Width 20"),
                    new ToggleButton(150, 10 + (40 * 5), "5 Padding", 5),
                    new ToggleButton(150, 10 + (40 * 6), "10 Padding", 10),

                    //Standard old checkbox
                    new CheckBox(300, 10, "Check Box"),

                    //Standard old radio button
                    //Only one radio buttons in the same group can have a value of true
                    new RadioButton(300, 40, "GRP", "Group GRP"),
                    new RadioButton(300, 70, "GRP", "Group GRP"),
                    new RadioButton(300, 100, "GRP", "Group GRP"),

                    //Slider allowing anologue selection. Value is the percent selected between 0 and 1 inclusive.
                    _slider = new Slider(300, 130, 200, delegate(Widget slider) {
                        _sliderLabel.Value = "Value = " + ((Slider)slider).Value;
                    }),
                    _sliderLabel = new Label(300, 160, "Value = 0"),

                    _singleLineTextBox = new SingleLineTextBox(300, 180, 100, 10),
                    new Button(410, 177, 100, "Change", delegate {
                        var result = 0.0f;
                        if (float.TryParse(_singleLineTextBox.Value, out result)) {
                            _slider.Value = result;
                        }
                    }),

                    //Combo box allowing that expands to allow the user to select one of the items in the DropDownItem List.
                    new ComboBox(300, 210, "Pick a Color", 2, CardinalDirection.North, new List<ComboBox.DropDownItem> { //The padding argument behaves the same as for the Button
                        new ComboBox.DropDownItem("Violet", null, delegate { Color = Color.Violet; }),
                        new ComboBox.DropDownItem("Tomato", null, delegate { Color = Color.Tomato; }),
                        new ComboBox.DropDownItem("YellowGreen", null, delegate { Color = Color.YellowGreen; }),
                        new ComboBox.DropDownItem("LightSkyBlue", null, delegate { Color = Color.LightSkyBlue; })
                    }),
                    new ComboBox(300, 250, 131, "Holder Text", CardinalDirection.South, new List<ComboBox.DropDownItem> {
                        new ComboBox.DropDownItem("Test 1"),
                        new ComboBox.DropDownItem("Test 2"),
                        new ComboBox.DropDownItem("Test 3"),
                        new ComboBox.DropDownItem("Test 4"),
                        new ComboBox.DropDownItem("Test 5")
                    }),

                    //For labels with icons the label is centered in the height of the icon
                    new Label(450, 10, "Research"),
                    new Label(450, 40, beaker, "Research"),
                    new Label(450, 70, beaker, "Research", 4), //Use the optional field for padding

                    //ScrollBars no longer have borders so nest them in panels if you need them.
                    //Panels have a min size of twice the renderers border width.
                    new Panel(10, 300, 220, 220) {
                        Children = new Widget[] {
                            new ScrollBars {
                                Children = new Widget[] {
                                    new CheckBox(10, 10, "Button"),
                                    new CheckBox(210, 10, "Button"),
                                    new CheckBox(10, 210, "Button"),
                                    new CheckBox(210, 210, "Button")
                                }
                            }
                        }
                    },

                    //TextBoxs no longer have borders so nest them in panels if you need them.
                    new Panel(240, 300, 400, 400) {
                        Children = new Widget[] {
                            new TextBox(2, 800) { Value = "This is a textbox!" }
                        }
                    },

                    new SingleLineTextBox(10, 525, 120, 10), //Basic Test
                    new SingleLineTextBox(10, 550, 120, 10) { Value = "0123456789" }, //Test with default value
                    new SingleLineTextBox(10, 575, 120, 10) { Value = "0123456789", Text = "testText" } //Test with specified font
                }
            };
        }
예제 #14
0
        /// <summary>
        /// Ładowanie graficznych kontentów i ogolnie wszstkich
        /// </summary>
        protected override void LoadContent()
        {
            GreyImageMap = Game.Content.Load<Texture2D>("ImageMap");
                GreyMap = File.OpenText(Game.Content.RootDirectory + @"\Map.txt").ReadToEnd();
                GreySpriteFont = Game.Content.Load<SpriteFont>("font");

                var skin = new Skin(GreyImageMap, GreyMap);
                //var text = new Text(GreySpriteFont, Color.LightGray);

                TextRenderer text = new Ruminate.GUI.Framework.TextRenderer(GreySpriteFont, Color.White);
                PanelHeader = new Ruminate.GUI.Framework.Text(GreySpriteFont, Color.White);

                TextBox login = new TextBox(16, 16);
                TextBox haslo = new TextBox(8, 8);

                myGui = new Gui(this.Game, skin, text);
                myGui.AddWidget(login);

                spriteBatch = new SpriteBatch(this.GraphicsDevice);
                // ladowanie fontu z assetow
                //contentFont = Game.Content.Load<SpriteFont>("font");

                komunikat = "Zarejestruj swoje konto, aby grac";

                Vector2 wymiarKom = GreySpriteFont.MeasureString(komunikat);
                wspNaSrodek = new Vector2((GraphicsDevice.Viewport.TitleSafeArea.Width - wymiarKom.X) / 2, (GraphicsDevice.Viewport.TitleSafeArea.Height - wymiarKom.Y) / 2);

                base.LoadContent();
        }
예제 #15
0
        public void Init()
        {
            greyImageMap = game.Content.Load<Texture2D>(@"GreySkin\ImageMap");
            greyMap = File.OpenText(@"Content\GreySkin\Map.txt").ReadToEnd();
            greySpriteFont = game.Content.Load<SpriteFont>(@"GreySkin\Texture");
            testImageMap = game.Content.Load<Texture2D>(@"TestSkin\ImageMap");
            testMap = File.OpenText(@"Content\TestSkin\Map.txt").ReadToEnd();
            testSpriteFont = game.Content.Load<SpriteFont>(@"TestSkin\Font");

            var skin = new Skin(this.greyImageMap, this.greyMap);
            var text = new Text(this.greySpriteFont, Color.White);

            var testSkin = new Skin(this.testImageMap, this.testMap);
            var testText = new Text(this.testSpriteFont, Color.White);

            var testSkins = new[] { new Tuple<string, Skin>("testSkin", testSkin) };
            var testTexts = new[] { new Tuple<string, Text>("testText", testText) };

            Button clearButton = new Button(0, 5, "Clear Drawing", 5, delegate { game.resetDrawing(); });

            comboBox = new ComboBox(755, 5, 200, "Choose Style", CardinalDirection.South, new List<ComboBox.DropDownItem>{
                new ComboBox.DropDownItem("No Style", null, null),
                new ComboBox.DropDownItem("Color Style", null, null),
                new ComboBox.DropDownItem("Test Style", null, null),
                new ComboBox.DropDownItem("Greek Style", null, null),
                new ComboBox.DropDownItem("ZigZag Style", null,null)
            });

            slider = new Slider(980, 10, 150, delegate{
                sliderLabel.Value = "" + Math.Round(((Slider)slider).Value * 99 + 1, 2);
            });
            sliderLabel = new Label(1122, 12, "1");
            slider.Value = 0.3f;

            slider2 = new Slider(1170, 10, 150, delegate
            {
                sliderLabel2.Value = "" + Math.Round(((Slider)slider2).Value * 39 + 1, 2);
            });
            sliderLabel2 = new Label(1312, 12, "1");
            slider2.Value = 0.3f;

            drawToggleButton = new ToggleButton(200, 5, "Moving Mode", 5);
            polyToggleButton = new ToggleButton(325, 5, "Drawing Poly", 5);
            newHoleToggleButton = new ToggleButton(445, 5, "Current Hole", 10);
            removeHoleButton = new Button(575, 5, "Remove Sel. Hole", 5);
            removeHoleButton.ClickEvent += delegate { game.removeSelectedHole(); };

            //drawToggleButton.OnToggle += delegate { polyToggleButton.IsToggled = false; };
            //polyToggleButton.OnToggle += delegate { drawToggleButton.IsToggled = false; };

            gui = new Gui(game, skin, text, testSkins, testTexts)
            {
                Widgets = new Widget[] { clearButton, drawToggleButton, polyToggleButton, newHoleToggleButton, removeHoleButton, comboBox, slider, sliderLabel, slider2, sliderLabel2 }
            };
        }