Beispiel #1
0
 public void drawMenu(Graphics g, MenuFactory menuFactory)
 {
     if (menuFactory.getCurrentMenu().isAnimationFinished())
     {
         g.DrawImage(menuFactory.getCurrentMenu().getMenuImage(), MENU_DRAW_LOCATION);
     }
     else
     {
         g.DrawImage(menuFactory.getCurrentMenu().getAnimationImages()[menuFactory.getCurrentMenu().getAnimationIndex()], MENU_DRAW_LOCATION);
         menuFactory.getCurrentMenu().advanceAnimation();
     }
 }
Beispiel #2
0
        public void menuMove(MenuFactory menuFactory, GameState gs)
        {
            if (keysDown.Contains(Keys.W))
            {
                menuFactory.getCurrentMenu().moveUp();
            }
            else if (keysDown.Contains(Keys.A))
            {
                menuFactory.getCurrentMenu().moveLeft();
            }
            else if (keysDown.Contains(Keys.S))
            {
                menuFactory.getCurrentMenu().moveDown();

            }
            else if (keysDown.Contains(Keys.D))
            {
                menuFactory.getCurrentMenu().moveLeft();
            }
            else if (keysDown.Contains(Keys.Enter))
            {
                menuFactory.swapMenus();
            }
        }
Beispiel #3
0
 public void drawHighlightedMenu(Graphics g, MenuFactory menuFactory)
 {
     currentButton =  menuFactory.getCurrentMenu().getButtons()[menuFactory.getCurrentMenu().getPosition().Y, menuFactory.getCurrentMenu().getPosition().X];
     g.DrawImage(currentButton.getHighlightImage(), currentButton.getLocation());
 }