mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-03 18:14:18 +02:00
Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui
This commit is contained in:
@@ -37,6 +37,15 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
||||
private TestWorld testWorld;
|
||||
private boolean isSettingsMenuOpen = false;
|
||||
private boolean inputBlocked = false;
|
||||
/**
|
||||
* Path to the styles script for GUI elements.
|
||||
*/
|
||||
private static final String STYLES_SCRIPT = "Interface/Lemur/pp-styles.groovy"; //NON-NLS
|
||||
/**
|
||||
* Path to the font resource used in the GUI.
|
||||
*/
|
||||
private static final String FONT = "Interface/Fonts/Default.fnt"; //NON-NLS
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
new MonopolyApp().start();
|
||||
@@ -73,8 +82,9 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
||||
@Override
|
||||
public void simpleInitApp() {
|
||||
GuiGlobals.initialize(this);
|
||||
BaseStyles.loadGlassStyle();
|
||||
GuiGlobals.getInstance().getStyles().setDefaultStyle("glass");
|
||||
BaseStyles.loadStyleResources(STYLES_SCRIPT);
|
||||
GuiGlobals.getInstance().getStyles().setDefaultStyle("pp"); //NON-NLS
|
||||
final BitmapFont normalFont = assetManager.loadFont(FONT); //NON-NLS
|
||||
|
||||
setupInput();
|
||||
setupGui();
|
||||
|
@@ -60,14 +60,6 @@ public class StartMenu extends Dialog {
|
||||
startButton.setFontSize(40); // Set the font size for the button text
|
||||
startButton.setTextHAlignment(HAlignment.Center); // Center the text horizontally
|
||||
|
||||
// Set a custom border and background color
|
||||
ColorRGBA borderColor = ColorRGBA.Orange; // Example: White border
|
||||
ColorRGBA backgroundColor = ColorRGBA.LightGray; // Example: light gray background
|
||||
QuadBackgroundComponent backgroundColorSp = new QuadBackgroundComponent(backgroundColor);
|
||||
backgroundColorSp.setMargin(2, 2); // Optional: Adjust margin for the border
|
||||
backgroundColorSp.setColor(borderColor); // Set border color
|
||||
startButton.setBackground(backgroundColorSp);
|
||||
|
||||
startButton.addClickCommands(source -> startGame(app));
|
||||
centerMenu.addChild(startButton);
|
||||
|
||||
@@ -82,7 +74,7 @@ public class StartMenu extends Dialog {
|
||||
lowerLeftMenu.setLocalTranslation(new Vector3f(100, 90, 0));
|
||||
Button quitButton = new Button("Spiel beenden");
|
||||
quitButton.setPreferredSize(new Vector3f(130, 40, 0)); // Increase button size slightly (width, height)
|
||||
quitButton.setFontSize(20);
|
||||
quitButton.setFontSize(18);
|
||||
quitButton.addClickCommands(source -> quitGame());
|
||||
lowerLeftMenu.addChild(quitButton);
|
||||
app.getGuiNode().attachChild(lowerLeftMenu);
|
||||
@@ -92,7 +84,7 @@ public class StartMenu extends Dialog {
|
||||
lowerRightMenu.setLocalTranslation(new Vector3f(screenWidth - 200, 90, 0));
|
||||
Button settingsButton = new Button("Einstellungen");
|
||||
settingsButton.setPreferredSize(new Vector3f(130, 40, 0)); // Increase button size slightly (width, height)
|
||||
settingsButton.setFontSize(20); // Increase the font size for the text
|
||||
settingsButton.setFontSize(18); // Increase the font size for the text
|
||||
settingsButton.addClickCommands(source -> openSettings(app));
|
||||
lowerRightMenu.addChild(settingsButton);
|
||||
app.getGuiNode().attachChild(lowerRightMenu);
|
||||
|
Reference in New Issue
Block a user