mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-01 06:27:40 +02:00
Änderungs des StartBildschirms
This commit is contained in:
@@ -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 |
Reference in New Issue
Block a user