Änderungs des StartBildschirms

This commit is contained in:
Luca Puderbach
2024-11-15 01:25:09 +01:00
parent 853b52b52d
commit 12ef219064
6 changed files with 38 additions and 41 deletions

View File

@@ -1,6 +1,10 @@
package pp.monopoly.client;
import com.jme3.material.Material;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Quad;
import com.jme3.texture.Texture;
import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label;
@@ -31,6 +35,16 @@ public class StartMenu extends Dialog {
*/
public static void createStartMenu(MonopolyApp app) {
Container mainMenu = new Container();
Texture backgroundImage = app.getAssetManager().loadTexture("Pictures/unibw-Bib2.png");
Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); // Vollbildgröße
Geometry background = new Geometry("Background", quad);
Material backgroundMaterial = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
backgroundMaterial.setTexture("ColorMap", backgroundImage);
background.setMaterial(backgroundMaterial);
background.setLocalTranslation(0, 0, -1); // Hintergrundebene
// Bild zum guiNode hinzufügen, damit es im Hintergrund bleibt
app.getGuiNode().attachChild(background);
mainMenu.setLocalTranslation(new Vector3f(300, 300, 0)); // Positionierung des Menüs
// Titel des Hauptmenüs
@@ -52,28 +66,19 @@ public class StartMenu extends Dialog {
app.getGuiNode().attachChild(mainMenu);
}
/**
* Starts the game by transitioning to the CreateGameMenu.
*/
private static void startGame(MonopolyApp app) {
app.getGuiNode().detachAllChildren(); // Schließt das Startmenü
app.getGuiNode().detachAllChildren();
CreateGameMenu createGameMenu = new CreateGameMenu(app);
// Code zur Anzeige des CreateGameMenu, eventuell zusätzliche Initialisierung
// Weitere Initialisierung des CreateGameMenu
}
/**
* Opens the settings menu.
*/
private static void openSettings(MonopolyApp app) {
app.getGuiNode().detachAllChildren(); // Schließt das Startmenü
app.getGuiNode().detachAllChildren();
SettingsMenu settingsMenu = new SettingsMenu(app);
// Code zur Anzeige des SettingsMenu
// Weitere Initialisierung des SettingsMenu
}
/**
* Quits the game application.
*/
private static void quitGame() {
System.exit(0); // Beendet die Anwendung
System.exit(0);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 MiB