added menu and related resources

This commit is contained in:
shebang
2015-01-13 04:03:33 +01:00
parent 8cba33a4bd
commit 2024c2f08b
6 changed files with 304 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,125 @@
package de.heatup.ui.menu;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import de.heatup.ui.FontLoader;
public class CreditsPanel {
private static JPanel credits = new JPanel();
private static GridLayout grid = new GridLayout(9, 1);
// font settings
private static FontLoader fl = new FontLoader();
private static Font emulogic;
private static Font emulogicHeadline;
private static Font emulogicDivider;
private static Font ttfbase;
// panels and labels
private static JPanel headline, divider, divider2, name1, name2, name3, name4, name5;
private static JLabel headlineLabel, dividerLabel, dividerLabel2, name1Label, name2Label, name3Label, name4Label, name5Label;
public CreditsPanel() { }
public static void setCreditsPanel() {
credits.setBackground(Color.BLACK);
credits.setLayout(grid);
ttfbase = FontLoader.getFont();
emulogicHeadline = ttfbase.deriveFont(Font.PLAIN, 28);
emulogic = ttfbase.deriveFont(Font.PLAIN, 12);
emulogicDivider = ttfbase.deriveFont(Font.PLAIN, 20);
createCredits();
}
private static void createCredits() {
headline = new JPanel();
headline.setBackground(Color.BLACK);
headlineLabel = new JLabel("HeatUp - Credits");
headlineLabel.setForeground(Color.YELLOW);
headlineLabel.setFont(emulogicHeadline);
headline.add(headlineLabel);
divider = new JPanel();
divider.setBackground(Color.BLACK);
dividerLabel = new JLabel("-----------------------------------");
dividerLabel.setForeground(Color.YELLOW);
dividerLabel.setFont(emulogicDivider);
divider.add(dividerLabel);
divider2 = new JPanel();
divider2.setBackground(Color.BLACK);
dividerLabel2 = new JLabel("-----------------------------------");
dividerLabel2.setForeground(Color.YELLOW);
dividerLabel2.setFont(emulogicDivider);
divider2.add(dividerLabel2);
name1 = new JPanel();
name1.setBackground(Color.BLACK);
name1Label = new JLabel("Daniel Aberger - daniel.aberger@stud.hs-hannover.de");
name1Label.setForeground(Color.YELLOW);
name1Label.setFont(emulogic);
name1.add(name1Label);
name2 = new JPanel();
name2.setBackground(Color.BLACK);
name2Label = new JLabel("Andreas Hainke - andreas.hainke@stud.hs-hannover.de");
name2Label.setForeground(Color.YELLOW);
name2Label.setFont(emulogic);
name2.add(name2Label);
name3 = new JPanel();
name3.setBackground(Color.BLACK);
name3Label = new JLabel("Ivan Parsikov - ivan.parsikov@stud.hs-hannover.de");
name3Label.setForeground(Color.YELLOW);
name3Label.setFont(emulogic);
name3.add(name3Label);
name4 = new JPanel();
name4.setBackground(Color.BLACK);
name4Label = new JLabel("Felix Kleinschmidt - felix.kleinschmidt@stud.hs-hannover.de");
name4Label.setForeground(Color.YELLOW);
name4Label.setFont(emulogic);
name4.add(name4Label);
name5 = new JPanel();
name5.setBackground(Color.BLACK);
name5Label = new JLabel("Tim Carlsson - tim-nils.carlsson@stud.hs-hannover.de");
name5Label.setForeground(Color.YELLOW);
name5Label.setFont(emulogic);
name5.add(name5Label);
credits.add(headline);
credits.add(divider);
credits.add(name1);
credits.add(name2);
credits.add(name3);
credits.add(name4);
credits.add(name5);
credits.add(divider2);
}
public static JPanel getCreditsPanel() {
credits.setVisible(false);
return credits;
}
}
@@ -0,0 +1,5 @@
package de.heatup.ui.menu;
public class HighscorePanel {
}
+174
View File
@@ -0,0 +1,174 @@
package de.heatup.ui.menu;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import de.heatup.ui.FontLoader;
public class MenuPanel {
// main menu panel
private static JPanel menuPanel = new JPanel();
// panels for menu buttons
static JPanel start, end, highscore, credits, tutorial;
// sub buttons for functions
static JLabel startGame, endGame, showHighscore, showCredits, showTutorial;
// font settings
private static FontLoader fl = new FontLoader();
private static Font emulogic;
private static Font ttfbase;
public MenuPanel() {
/** not in usage yet */
}
public static void setMenuPanel() {
GridLayout menuGrid = new GridLayout(5, 1);
menuPanel.setBackground(Color.BLACK);
menuPanel.setLayout(menuGrid);
ttfbase = FontLoader.getFont();
emulogic = ttfbase.deriveFont(Font.PLAIN, 28);
createStart();
createEnd();
createHighscore();
createCredits();
createTutorial();
buildMenuPanel();
}
public static JPanel getMenuPanel() {
menuPanel.setVisible(true);
return menuPanel;
}
/**
* Create a JPanel which contains full function for starting a new Game
*/
private static void createStart() {
start = new JPanel();
start.setBackground(Color.BLACK);
startGame = new JLabel("[ Spiel starten ]");
startGame.setForeground(Color.YELLOW);
startGame.setFont(emulogic);
startGame.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
// @TODO: implement start game
System.out.println("game started");
}
});
start.add(startGame);
}
/**
* Create a JPanel which contains full function for Ending the current game
*/
private static void createEnd() {
end = new JPanel();
end.setBackground(Color.BLACK);
endGame = new JLabel("[ Spiel beenden ]");
endGame.setForeground(Color.YELLOW);
endGame.setFont(emulogic);
endGame.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
// @TODO: implement end game
System.out.println("game ended");
}
});
end.add(endGame);
}
/**
* Create a JPanel which contains full function for showing the Highscores
*/
private static void createHighscore() {
highscore = new JPanel();
highscore.setBackground(Color.BLACK);
showHighscore = new JLabel("[ Highscores anzeigen ]");
showHighscore.setForeground(Color.YELLOW);
showHighscore.setFont(emulogic);
showHighscore.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
// @TODO: implement show highscore
System.out.println("show highscore");
}
});
highscore.add(showHighscore);
}
/**
* Create a JPanel which contains full function for showing the Credits
*/
private static void createCredits() {
credits = new JPanel();
credits.setBackground(Color.BLACK);
showCredits = new JLabel("[ Credits anzeigen ]");
showCredits.setForeground(Color.YELLOW);
showCredits.setFont(emulogic);
showCredits.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
// @TODO: implement show credits
menuPanel.setVisible(false);
System.out.println("show credits");
}
});
credits.add(showCredits);
}
/**
* Create a JPanel which contains full function for showing the Tutorial
*/
private static void createTutorial() {
tutorial = new JPanel();
tutorial.setBackground(Color.BLACK);
showTutorial = new JLabel("[ Tutorial starten ]");
showTutorial.setForeground(Color.YELLOW);
showTutorial.setFont(emulogic);
showTutorial.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
// @TODO: implement show tutorial
System.out.println("show tutorial");
}
});
tutorial.add(showTutorial);
}
/**
* building the MenuPanel from all previous created panels
* */
private static void buildMenuPanel() {
menuPanel.add(start);
menuPanel.add(end);
menuPanel.add(highscore);
menuPanel.add(credits);
menuPanel.add(tutorial);
}
}