diff --git a/src/windowInterface/JPanelChessBoard.java b/src/windowInterface/JPanelChessBoard.java index 78a68de..3e4aad5 100644 --- a/src/windowInterface/JPanelChessBoard.java +++ b/src/windowInterface/JPanelChessBoard.java @@ -80,7 +80,28 @@ public class JPanelChessBoard extends JPanel { @Override protected void paintComponent(Graphics g) { super.paintComponent(g); - this.setBackground(Color.black); + this.setBackground(new Color(170, 51, 106)); + + if (myGame == null) { + // Display title before game starts + g.setColor(Color.WHITE); + g.setFont(g.getFont().deriveFont(48f)); // larger font size + String title = "Chess Project"; + int stringWidth = g.getFontMetrics().stringWidth(title); + int x = (getWidth() - stringWidth) / 2; + int y = getHeight() / 2; + g.drawString(title, x, y); + + g.setFont(g.getFont().deriveFont(24f)); // Smaller font for subtitle + String subtitle = "Groupe 2A5"; + int subtitleWidth = g.getFontMetrics().stringWidth(subtitle); + int x2 = (getWidth() - subtitleWidth) / 2; + int y2 = y + 40; // 40 pixels below the title, adjust spacing if needed + g.drawString(subtitle, x2, y2); + + return; + } + if(pieceSelectorMode) { g.drawImage( spriteSheet,