35 lines
783 B
Java
35 lines
783 B
Java
|
/**
|
||
|
* La classe <code>HUD</code> est utilisée pour générer le HUD (interface) du jeu.
|
||
|
*
|
||
|
* @version 0.1
|
||
|
* @author Adil HAMMERSCHMIDT & Lucas GRANDJEAN
|
||
|
*/
|
||
|
|
||
|
import java.awt.Color;
|
||
|
import javax.swing.*;
|
||
|
import javax.swing.border.MatteBorder;
|
||
|
|
||
|
public class HUD extends JPanel {
|
||
|
|
||
|
private int score = 0;
|
||
|
public JLabel label2;
|
||
|
/**
|
||
|
*Constructeur du HUD : Genère un HUD.
|
||
|
*/
|
||
|
public HUD() {
|
||
|
this.setBorder(new MatteBorder(1, 1, 2, 1, Color.black));
|
||
|
JLabel label = new JLabel("Score : ");
|
||
|
label2 = new JLabel(Integer.toString(score));
|
||
|
this.add(label);
|
||
|
this.add(label2);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Setter du Score.
|
||
|
*/
|
||
|
public void setScoreLabel(int score) {
|
||
|
label2.setText(Integer.toString(score));
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|