예제 #1
0
        public MainMenu(Game game, SpriteBatch spriteBatch, Screen parent)
            : base(game, spriteBatch, parent)
        {
            backgroundFile = "Images/mainMenu";
            items          = new List <MenuItem>(5);

            Button b = new Button(this, new Action(start), "Start");

            b.Position = new Vector2(300, 100);
            items.Add(b);

            NumericButton nb = new NumericButton(this, "Players");

            nb.Position = new Vector2(300, 200);
            nb.MinValue = 2;
            nb.MaxValue = 4;
            nb.Value    = 2;
            items.Add(nb);

            nb          = new NumericButton(this, "Rounds");
            nb.Position = new Vector2(300, 300);
            nb.MinValue = 1;
            nb.MaxValue = 10;
            nb.Value    = 4;
            items.Add(nb);

            b          = new Button(this, new Action(Game.Exit), "Exit");
            b.Position = new Vector2(300, 400);
            items.Add(b);
        }
예제 #2
0
        public MainMenu(Game game, SpriteBatch spriteBatch, Screen parent)
            : base(game, spriteBatch, parent)
        {
            backgroundFile = "Images/mainMenu";
            items = new List<MenuItem>(5);

            Button b = new Button(this, new Action(start), "Start");
            b.Position = new Vector2(300, 100);
            items.Add(b);

            NumericButton nb = new NumericButton(this, "Players");
            nb.Position = new Vector2(300, 200);
            nb.MinValue = 2;
            nb.MaxValue = 4;
            nb.Value = 2;
            items.Add(nb);

            nb = new NumericButton(this, "Rounds");
            nb.Position = new Vector2(300, 300);
            nb.MinValue = 1;
            nb.MaxValue = 10;
            nb.Value = 4;
            items.Add(nb);

            b = new Button(this, new Action(Game.Exit), "Exit");
            b.Position = new Vector2(300, 400);
            items.Add(b);
        }