mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 08:59:44 +02:00
Schriftarten implementiert in ActionPanel, powerUp Methode hinzugefügt,
This commit is contained in:
@@ -28,7 +28,7 @@ public class FontLoader {
|
||||
|
||||
}
|
||||
|
||||
public Font getFont(){
|
||||
public static Font getFont(){
|
||||
return ttfBase;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,12 +29,15 @@ public class StatusPanelAdder{
|
||||
private static double tempPlus=0.0;
|
||||
private static double tempMinus=0.0;
|
||||
private static double barSpeed=0.01;
|
||||
private static float red;
|
||||
private static float green;
|
||||
private static float blue;
|
||||
private static boolean ende=false;
|
||||
private static JLabel labelTempC= new JLabel("§");
|
||||
private static JLabel labelTemp= new JLabel("temperature");
|
||||
private static JProgressBar tempBar;
|
||||
private static JLabel labelScore= new JLabel("score");
|
||||
private static JLabel scoreLabel= new JLabel("new Score Label");
|
||||
private static JLabel scoreLabel= new JLabel();
|
||||
private static JLabel labelPowerUp = new JLabel("PowerUp");
|
||||
private static JLabel powerUpLabel = new JLabel(/*new ImageIcon("path_to_image.png")*/"powerUpLabel");
|
||||
private static JLabel labelTime=new JLabel("Time");
|
||||
@@ -43,6 +46,7 @@ public class StatusPanelAdder{
|
||||
private static Font emulogictext;
|
||||
private static Font ttfBase;
|
||||
private static FontLoader fl=new FontLoader();
|
||||
private static Color tempBarColor= new Color(0,0,255);
|
||||
|
||||
|
||||
|
||||
@@ -73,6 +77,9 @@ public class StatusPanelAdder{
|
||||
newPanel.setLayout(new FlowLayout(FlowLayout.CENTER, hgap,5));
|
||||
panel=newPanel;
|
||||
}
|
||||
public static void setPUText(String s){
|
||||
powerUpLabel.setText(s);
|
||||
}
|
||||
/**
|
||||
* erhöht die Anzahl Manipulationen
|
||||
*/
|
||||
@@ -96,7 +103,7 @@ public class StatusPanelAdder{
|
||||
timeLabel.setText(Timer.getMinuteS() + ":" + Timer.getSecondsS());
|
||||
|
||||
/**
|
||||
* Temperaturbearbeitung
|
||||
* Temperaturaktualisierung
|
||||
*/
|
||||
labelTempC.setText(tempBar.getValue() + "°C");
|
||||
temping=0;
|
||||
@@ -115,6 +122,15 @@ public class StatusPanelAdder{
|
||||
tempPlus=-1;
|
||||
}
|
||||
}
|
||||
red=((float)(((tempBar.getValue())-30)/80.0));
|
||||
blue=(1-red);
|
||||
Logger.write("Color number" + red);
|
||||
tempBarColor=new Color(red, green,blue, (float)0.65);
|
||||
tempBar.setForeground(tempBarColor);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (temping!=0){
|
||||
Logger.write("Temperatur: " + tempBar.getValue());
|
||||
@@ -138,7 +154,7 @@ public class StatusPanelAdder{
|
||||
* fügt dem der Klasse übergebenen Panel Objekte hinzu & formatiert diese
|
||||
*/
|
||||
public static void createPanel(){
|
||||
ttfBase=fl.getFont();
|
||||
ttfBase=FontLoader.getFont();
|
||||
emulogicheading = ttfBase.deriveFont(Font.PLAIN, 16);
|
||||
emulogictext= ttfBase.deriveFont(Font.PLAIN, 12);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.awt.Font;
|
||||
import javax.swing.*;
|
||||
|
||||
import de.heatup.mapengine.MapGrid;
|
||||
import de.heatup.ui.FontLoader;
|
||||
import de.heatup.ui.Main;
|
||||
|
||||
public class ActionControl{
|
||||
@@ -22,15 +23,25 @@ public class ActionControl{
|
||||
private static JLabel bigActionLabel;
|
||||
private static int tmpCount=0;
|
||||
private static boolean keyA=true;
|
||||
private static Font ttfBase=FontLoader.getFont();
|
||||
private static Font emulogicaction;
|
||||
private static Font emulogicbigaction;
|
||||
|
||||
public static void setPanel(JPanel newPanel){
|
||||
emulogicaction = ttfBase.deriveFont(Font.PLAIN, 12);
|
||||
emulogicbigaction= ttfBase.deriveFont(Font.LAYOUT_RIGHT_TO_LEFT, 25);
|
||||
|
||||
panel = newPanel;
|
||||
panel.setBackground(Color.BLACK);
|
||||
actionLabel = new JLabel();
|
||||
bigActionLabel = new JLabel();
|
||||
bar = new JProgressBar();
|
||||
actionLabel.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
||||
//actionLabel.setFont(new Font("Arial", Font.CENTER_BASELINE, 16));
|
||||
actionLabel.setFont(emulogicaction);
|
||||
actionLabel.setHorizontalAlignment(JLabel.CENTER);
|
||||
bigActionLabel.setFont(new Font("Arial", Font.LAYOUT_RIGHT_TO_LEFT,40));
|
||||
actionLabel.setForeground(Color.YELLOW);
|
||||
//bigActionLabel.setFont(new Font("Arial", Font.LAYOUT_RIGHT_TO_LEFT,40));
|
||||
bigActionLabel.setFont(emulogicbigaction);
|
||||
bigActionLabel.setForeground(Color.RED);
|
||||
bigActionLabel.setHorizontalAlignment(JLabel.CENTER);
|
||||
bigActionLabel.setVisible(false);
|
||||
|
||||
Reference in New Issue
Block a user