Ejemplo n.º 1
0
 public MainMenuButton(string text, string help, int x, int y, Action action, Fonts font = Fonts.Menu)
 {
     HelpText       = help;
     vis            = GUCVisualText.Create(text, x, y);
     visText        = vis.Texts[0];
     visText.Format = GUCVisualText.TextFormat.Center;
     vis.Font       = font;
     OnActivate     = action;
 }
Ejemplo n.º 2
0
        public MainMenuChoice(string title, string help, int x, int y, Dictionary <int, string> choices, bool sorted, Action OnActivate, Action OnChange)
        {
            HelpText        = help;
            this.sorted     = sorted;
            this.OnActivate = OnActivate;
            this.OnChange   = OnChange;

            titleVis = GUCVisualText.Create(title, x + (width - (int)StringPixelWidth(title)) / 2, y - 15);

            vis = new GUCVisual(x, y, width, height);
            vis.SetBackTexture("Menu_Choice_Back.tga");
            vis.CreateText("");

            sorted  = false;
            Choices = choices;
        }
Ejemplo n.º 3
0
        public MainMenuTextBox(string title, string help, int x, int y, int width, int titleX, int titleY, Action action)
        {
            HelpText   = help;
            OnActivate = action;

            //title text
            titleVis      = GUCVisualText.Create(title, titleX, titleY);
            titleVis.Font = Fonts.Menu;

            //background visual
            vis = new GUCVisual(x, y, width, height);
            vis.SetBackTexture(BackTexture);

            //text box
            tb             = new GUCTextBox(x + 15, y + 5, width - 30, true);
            tb.AllowSpaces = false;
            Update         = tb.Update;
        }
Ejemplo n.º 4
0
        public GUCMainMenu()
        {
            var screenSize = GUCView.GetScreenSize();

            pos  = new int[] { (screenSize.X - 640) / 2, (screenSize.Y - 480) / 2 };
            Back = new GUCVisual(pos[0], pos[1], 640, 480);
            Back.SetBackTexture("Menu_Ingame.tga");
            Back.Font = GUCVisual.Fonts.Menu;

            helpVis            = GUCVisualText.Create("", 0, pos[1] + 455);
            helpText.CenteredX = true;

            scrollHelper = new KeyHoldHelper()
            {
                { () => MoveCursor(true), VirtualKeys.Up },
                { () => MoveCursor(false), VirtualKeys.Down },
                { () => MoveCursor(false), VirtualKeys.Tab },
            };
        }