Ejemplo n.º 1
0
        public MainMenu() : base(false)
        {
            // TODO: Is it okay that assets can only be loaded into the active scene's libraries?
            sceneType = SceneType.Menu;

            Entity entity;

            entity = new Entity(this, entityList).AddBody(100f, 100f).AddSprite("ball");
            entity.SetVelocity(20f, 10f);

            entity  = new Entity(this, entityList).AddText("default", "N/A", 5f, 5f, Color.Cyan, 1f);
            stop1   = entity;
            message = new StringBuilder("Type: ");

            //menu = new Systems.MenuGroup(Systems.MenuOrder.vertical, MenuSelect, MenuDeselect);
            menu = new MenuGroup();
            menu.Add(new Entity(this, entityList).AddText("default", "Start", 100f, 100f, menuTextColor, 1f));
            menu.Add(new Entity(this, entityList).AddText("default", "Config", 100f, 200f, menuTextColor, 1f));
            menu.Last().MenuControl.SetAction(GameCommand.MenuConfirm, MCConfig);
            menu.Add(new Entity(this, entityList).AddText("default", "Exit", 100f, 300f, menuTextColor, 1f));
            menu.Last().MenuControl.SetAction(GameCommand.MenuConfirm, MCExit);
            menu.SetSelect(MCSelect);
            menu.SetDeselect(MCDeselect);
            menu.Refresh();

            // TODO: Consider moving this to the base Scene library, and Start() or Stop via a flag in the constructor.
            //   Though it might need to be started and stopped within certain scenes? Unless all typing popups are
            //   handled as scenes of their own.
            //GlobalServices.TextHandler.Start();
        }
Ejemplo n.º 2
0
        public MenuConfig() : base(false)
        {
            // TODO: Is it okay that assets can only be loaded into the active scene's libraries?
            sceneType = SceneType.Menu;

            menu = new MenuGroup();
            menu.Add(new Entity(this, entityList).AddText("default", "854x480", 200f, 120f, MainMenu.menuTextColor, 1f));
            menu.Last().MenuControl.SetAction(GameCommand.MenuConfirm, MCRes480);
            menu.Add(new Entity(this, entityList).AddText("default", "1280x720", 200f, 220f, MainMenu.menuTextColor, 1f));
            menu.Last().MenuControl.SetAction(GameCommand.MenuConfirm, MCRes720);
            menu.Add(new Entity(this, entityList).AddText("default", "1920x1080", 200f, 320f, MainMenu.menuTextColor, 1f));
            menu.Last().MenuControl.SetAction(GameCommand.MenuConfirm, MCRes1080);
            menu.Add(new Entity(this, entityList).AddText("default", "Fullscreen", 200f, 420f, MainMenu.menuTextColor, 1f));
            menu.Last().MenuControl.SetAction(GameCommand.MenuConfirm, MCResFullscreen);
            menu.Add(new Entity(this, entityList).AddText("default", "Back", 180f, 520f, MainMenu.menuTextColor, 1f));
            menu.Last().MenuControl.SetAction(GameCommand.MenuConfirm, MCBack);
            menu.SetSelect(MainMenu.MCSelect);
            menu.SetDeselect(MainMenu.MCDeselect);
            menu.Refresh();
            // TODO/DEBUG: Allow typing in custom resolutions to see what happens. (Or could implement this in the upcoming console.)

            // TODO: This shouldn't be necessary:
            //GlobalServices.TextHandler.Stop();
        }