예제 #1
0
        void createMapWindow()
        {
            Texture2D     mapA      = ScreenManager.Content.Load <Texture2D>(sim.mapPaths[0]);
            Texture2D     mapB      = ScreenManager.Content.Load <Texture2D>(sim.mapPaths[1]);
            MapElement    element   = new MapElement(mapA, mapB, SideTack.Center, returnMapPos);
            SpaceFillList mainCont  = new SpaceFillList(new float[] { 1 }, new Element[] { element }, false, "MainCont");
            Window        mapWindow = new Window(windows, ScreenManager.Content, new Rectangle(500, 0, mapA.Width, mapA.Height), TempGlobals.BorderColors, mainCont, "Map Name", true, true);

            mapWindow.BindInput(element.FullName, "Clicked", new EventHandler <MapImageEventArgs>(minimapClicked));
            windows.AddWindow(mapWindow);
        }
예제 #2
0
        public static Window CreateMessageBox(string message, Coordinate position, WindowManager manager)
        {
            ButtonElement element = new ButtonElement(new Button(new AABox(new Rectangle(0, 0, 88, 23)), ScreenManager.Content.Load <Texture2D>(".//UI//Exit Button.png"),
                                                                 new Rectangle[] { new Rectangle(0, 0, 88, 23), new Rectangle(0, 23, 88, 23), new Rectangle(0, 46, 88, 23), new Rectangle(0, 69, 88, 23) },
                                                                 Coordinate.Zero), new Coordinate(88, 23), "Close", SideTack.Center);
            SpaceFillList container = new SpaceFillList(new float[] { 1.5f, 1 }, new Element[] { new TextElement(message,
                                                                                                                 "MSSansSerif", Color.Green, "Text", ResizeKind.FillRatio), element }, new Rectangle(0, 0, 300, 70), Coordinate.Zero, false, false, Color.Black, "TopCont");
            Window messageBox = new Window(manager, ScreenManager.Content, new Rectangle(position.X, position.Y, 300, 70), TempGlobals.BorderColors, container);

            messageBox.BindInput(element.FullName, "Released", new EventHandler(messageBox.CloseWindow));
            return(messageBox);
        }
예제 #3
0
        public void AddThingModWindow(TempThing thing)
        {
            ButtonElement element = new ButtonElement(new Button(new AABox(new Rectangle(0, 0, 88, 23)), ScreenManager.Content.Load <Texture2D>(".//UI//Exit Button.png"),
                                                                 new Rectangle[] { new Rectangle(0, 0, 88, 23), new Rectangle(0, 23, 88, 23), new Rectangle(0, 46, 88, 23), new Rectangle(0, 69, 88, 23) },
                                                                 Coordinate.Zero), new Coordinate(88, 23), "Rotate Color", SideTack.Center);
            SpaceFillList container = new SpaceFillList(new float[] { 1.5f, 1 }, new Element[] { new TextElement("Click to Change Color",
                                                                                                                 "MSSansSerif", Color.Green, "Text", ResizeKind.FillRatio), element }, new Rectangle(0, 0, 300, 70), Coordinate.Zero, false, false, Color.Black, "TopCont");
            Window messageBox = new Window(manager, ScreenManager.Content, new Rectangle(50, 0, 175, 70), TempGlobals.BorderColors, container);

            messageBox.BindInput(element.FullName, "Released", new EventHandler(thing.Change));
            manager.AddWindow(messageBox);
        }
예제 #4
0
        public Window CreateMainMenu()
        {
            Texture2D buttonSheet = ScreenManager.Content.Load <Texture2D>(".//Old Content//UI//Buttons.png");
            AABox     buttonBox   = new AABox(new Rectangle(0, 0, 87, 23));

            FlatColorElement spacer1 = new FlatColorElement(new Color(255, 255, 255, 0), "Spacer 1");
            ButtonElement    newGame = new ButtonElement(new Button(new AABox(buttonBox), buttonSheet,
                                                                    new Rectangle[] { new Rectangle(406, 0, 87, 23), new Rectangle(406, 0, 87, 23), new Rectangle(406, 23, 87, 23), new Rectangle(406, 0, 87, 23) },
                                                                    new Coordinate(0, 0)), new Coordinate(87, 23), "New Game", SideTack.Center);

            newGame.Clicked += onClickNewGame;
            ButtonElement intro = new ButtonElement(new Button(new AABox(buttonBox), buttonSheet,
                                                               new Rectangle[] { new Rectangle(406, 46, 87, 23), new Rectangle(406, 46, 87, 23), new Rectangle(406, 69, 87, 23), new Rectangle(406, 46, 87, 23) },
                                                               new Coordinate(0, 0)), new Coordinate(87, 23), "Introduction", SideTack.Center);

            intro.Clicked += onClickIntroduction;
            ButtonElement loadGame = new ButtonElement(new Button(new AABox(buttonBox), buttonSheet,
                                                                  new Rectangle[] { new Rectangle(406, 92, 87, 23), new Rectangle(406, 92, 87, 23), new Rectangle(406, 115, 87, 23), new Rectangle(406, 92, 87, 23) },
                                                                  new Coordinate(0, 0)), new Coordinate(87, 23), "Load Game", SideTack.Center);

            loadGame.Clicked += onClickLoadGame;
            ButtonElement prefs = new ButtonElement(new Button(new AABox(buttonBox), buttonSheet,
                                                               new Rectangle[] { new Rectangle(406, 138, 87, 23), new Rectangle(406, 138, 87, 23), new Rectangle(406, 161, 87, 23), new Rectangle(406, 138, 87, 23) },
                                                               new Coordinate(0, 0)), new Coordinate(87, 23), "Preferences", SideTack.Center);

            prefs.Clicked += onClickPreferences;
            ButtonElement exit = new ButtonElement(new Button(new AABox(buttonBox), buttonSheet,
                                                              new Rectangle[] { new Rectangle(406, 184, 87, 23), new Rectangle(406, 184, 87, 23), new Rectangle(406, 207, 87, 23), new Rectangle(406, 184, 87, 23) },
                                                              new Coordinate(0, 0)), new Coordinate(87, 23), "Exit", SideTack.Center);

            exit.Clicked += onClickExit;
            TextElement version   = new TextElement("Version 0.01", "MSSansSerif", TempGlobals.BorderColors[1], "Version", ResizeKind.FillRatio);
            TextElement copyright = new TextElement("Copyright let's say Sierra, sure", "MSSansSerif", TempGlobals.BorderColors[1], "Copyright", ResizeKind.FillRatio);
            TextElement arr       = new TextElement("Please Don't Sue", "MSSansSerif", TempGlobals.BorderColors[1], "ARR", ResizeKind.FillRatio);

            SpaceFillList mainCont       = new SpaceFillList(new float[] { 0.2f, 1, 1, 1, 1, 1, 0.5f, 0.5f, 0.5f }, new Element[] { spacer1, newGame, intro, loadGame, prefs, exit, version, copyright, arr }, false, "TopCont");
            Rectangle     dimensions     = new Rectangle((ScreenManager.StaticGame.Window.ClientBounds.Width - 293) / 2, (ScreenManager.StaticGame.Window.ClientBounds.Height - 244) / 2, 293, 244);
            Window        mainMenuWindow = new Window(windows, ScreenManager.Content, dimensions, TempGlobals.BorderColors, mainCont, "Program Control", false);

            return(mainMenuWindow);
        }
예제 #5
0
        public void TestTextListWindow()
        {
            TextListElement element = new TextListElement(new ColumnOptions[] {
                new ColumnOptions {
                    Justified = Justification.Left, Spacing = 2
                }, new ColumnOptions {
                    Justified = Justification.Middle, Spacing = 1
                },
                new ColumnOptions {
                    Justified = Justification.Middle, Spacing = 1
                }, new ColumnOptions {
                    Justified = Justification.Right, Spacing = 1
                }
            },
                                                          Color.White, new Coordinate(400, 230), new Coordinate(400, 230), SideTack.Center, dataTest, "MSSansSerif");
            SpaceFillList container   = new SpaceFillList(new float[] { 1 }, new Element[] { element }, new Rectangle(0, 0, (int)element.IdealDimensions.X, (int)element.IdealDimensions.Y), Coordinate.Zero, false, true, "TopCont");
            Window        textListBox = new Window(manager, ScreenManager.Content, new Rectangle(75, 75, 500, 250), TempGlobals.BorderColors, container);

            triggerUpdates += textListBox.GetUpdater(element.FullName);
            manager.AddWindow(textListBox);
        }