Modification temporaire - Correction du bug de taille des boutons
This commit is contained in:
@@ -11,7 +11,7 @@ public class ButtonHoverAnimator {
|
||||
|
||||
private final JButton button;
|
||||
private final Color originalColor;
|
||||
private final Font originalFont;
|
||||
private static Font originalFont;
|
||||
private Timer animationTimer;
|
||||
private float currentScale = 1.0f;
|
||||
|
||||
@@ -30,4 +30,9 @@ public class ButtonHoverAnimator {
|
||||
animationTimer = new Timer(Options.ANIMATION_DELAY, new ButtonHoverAnimationListener(entering, button, originalColor, originalFont));
|
||||
animationTimer.start();
|
||||
}
|
||||
|
||||
public static void updateOriginalFont(float newFontSize) {
|
||||
originalFont = originalFont.deriveFont(newFontSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -6,6 +6,9 @@ import fr.monkhanny.dorfromantik.controller.MainMenuMouseController;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
public class ButtonPanel extends JPanel {
|
||||
|
||||
@@ -68,6 +71,10 @@ public class ButtonPanel extends JPanel {
|
||||
return exitButton;
|
||||
}
|
||||
|
||||
public List<JButton> getButtons() {
|
||||
return Arrays.asList(newGameButton, continueGameButton, howToPlayButton, settingsButton, exitButton);
|
||||
}
|
||||
|
||||
public void updateButtonFonts(int windowWidth) {
|
||||
// Mettre à jour la police des boutons avec la taille ajustée
|
||||
float newFontSize = windowWidth / 30f;
|
||||
|
Reference in New Issue
Block a user