예제 #1
0
 public IMenu CreateMainMenu(MenuPainter painter)
 {
     return new MainMenu(
         _graphicsManager.GetTexture("background"),
         painter,
         this
         );
 }
예제 #2
0
 public IMenu CreateGameMenu(MenuPainter painter)
 {
     return new GameMenu(
         painter.CreatePixel(Color.Black),
         painter,
         this
         );
 }
예제 #3
0
        public MainMenu(Texture2D background, MenuPainter painter, MenuFactory factory)
            : base(background, painter, factory)
        {
            var startButton = Factory.CreateMenuButton("NewSimulation");
            var exitButton = Factory.CreateMenuButton("Exit");

            startButton.Click += StartButtonOnClick;
            exitButton.Click += ExitButtonOnClick;
            Elements.Add(startButton);
            Elements.Add(exitButton);
            Resize();
        }
예제 #4
0
 public void LoadContent(MenuPainter painter, MenuFactory factory)
 {
     _menus.Add(factory.CreateMainMenu(painter));
     _menus.Add(factory.CreateGameMenu(painter));
 }
예제 #5
0
 protected SimpleMenu(Texture2D background, MenuPainter painter, MenuFactory factory)
 {
     Factory = factory;
     Painter = painter;
     SetBackground(background);
 }