Ejemplo n.º 1
0
        public override GuiManager Instantiate(string option, System.Action exit)
        {
            GuiManager guiManager = new GUIapp.GuiManager();

            switch (option)
            {
            default:
            {
                GuiElementCreator buttonConstructor = new ButtonConstructor();
                GuiElementCreator labelConstructor  = new LabelConstructor();
                guiManager.elements = new List <GuiElement>();
                guiManager.elements.Add(labelConstructor.Instantiate("Hi Ahmed!", new Point(0, 0), 10, Colour.Black));
                guiManager.elements.Add(buttonConstructor.Instantiate("Click me", new Point(0, 100), 10, Colour.Black, 100, 30,
                                                                      () => {
                        guiManager.elements = new List <GuiElement>();
                        guiManager.elements.Add(buttonConstructor.Instantiate("Exit", new Point(0, 0), 10, Colour.Black, 100, 30,
                                                                              () => {
                            exit();
                        }
                                                                              ));
                    }
                                                                      ));
                break;
            }
            }
            return(guiManager);
        }
Ejemplo n.º 2
0
        public override GuiManager Instantiate(string option, System.Action exit)
        {
            GuiManager        guiManager    = new GUIapp.GuiManager();
            GuiElementCreator buttonCreator = new ButtonConstructor();
            GuiElementCreator labelCreator  = new LabelConstructor();

            guiManager.elements = new List <GuiElement>();
            guiManager.elements.Add(buttonCreator.Instantiate("Smack me !!!", new Point(50, 50), 20, Colour.Blue));
            guiManager.elements.Add(buttonCreator.Instantiate("I do stuff", new Point(50, 150), 20, Colour.Black, 100, 50, exit));
            guiManager.elements.Add(buttonCreator.Instantiate("Ugly label", new Point(50, 30), 10, Colour.Black));
            guiManager.elements.Add(buttonCreator.Instantiate("Beuty label", new Point(50, 120), 10, Colour.Black));
            return(guiManager);
        }