mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-04 16:11:38 +02:00
menues angepasst und vorlage für dropdown implementiert
This commit is contained in:
@@ -12,6 +12,7 @@ import com.simsilica.lemur.Label;
|
||||
import com.simsilica.lemur.TextField;
|
||||
import com.simsilica.lemur.component.SpringGridLayout;
|
||||
|
||||
import com.simsilica.lemur.style.ElementId;
|
||||
import pp.monopoly.client.MonopolyApp;
|
||||
import pp.monopoly.client.StartMenu;
|
||||
|
||||
@@ -34,8 +35,10 @@ public class CreateGameMenu {
|
||||
menuContainer.setPreferredSize(new Vector3f(600, 400, 0)); // Feste Größe des Containers
|
||||
|
||||
// Titel
|
||||
Label title = menuContainer.addChild(new Label("Neues Spiel"));
|
||||
title.setFontSize(48);
|
||||
Label title = menuContainer.addChild(new Label("Neues Spiel", new ElementId("header")));
|
||||
title.setFont(app.getAssetManager().loadFont("Interface/Fonts/Metropolis/Metropolis-Bold-42.fnt"));
|
||||
title.setFontSize(50);
|
||||
|
||||
|
||||
// Eingabefelder-Container
|
||||
Container inputContainer = menuContainer.addChild(new Container(new SpringGridLayout(Axis.Y, Axis.X)));
|
||||
|
@@ -3,6 +3,7 @@ package pp.monopoly.client.gui;
|
||||
import com.jme3.material.Material;
|
||||
import com.jme3.material.RenderState.BlendMode;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.scene.Geometry;
|
||||
import com.jme3.scene.shape.Quad;
|
||||
import com.simsilica.lemur.Button;
|
||||
@@ -12,7 +13,9 @@ import com.simsilica.lemur.Label;
|
||||
import com.simsilica.lemur.Slider;
|
||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
|
||||
import com.simsilica.lemur.style.ElementId;
|
||||
import com.simsilica.lemur.ValueRenderer;
|
||||
|
||||
import com.simsilica.lemur.Selector;
|
||||
import pp.dialog.Dialog;
|
||||
import pp.monopoly.client.MonopolyApp;
|
||||
|
||||
@@ -61,6 +64,30 @@ public class SettingsMenu extends Dialog {
|
||||
backgroundMusicContainer.addChild(new Checkbox("Musik an")).setChecked(true);
|
||||
backgroundMusicContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
|
||||
|
||||
/*Selector<String> dropdown = new Selector<>();
|
||||
backgroundMusicContainer.addChild(dropdown);
|
||||
|
||||
Vector3f dimens = settingsContainer.getPreferredSize();
|
||||
Vector3f dimens2 = dropdown.getPopupContainer().getPreferredSize();
|
||||
dimens2.setX(dimens.getX());
|
||||
dropdown.getPopupContainer().setPreferredSize(dimens2);*/
|
||||
// Create the dropdown menu
|
||||
Selector<String> dropdown = new Selector<>();
|
||||
|
||||
// Generate and add numbered examples to the dropdown
|
||||
for (int i = 1; i <= 10; i++) { // Generate 10 examples
|
||||
dropdown.getModel().add("Example " + i);
|
||||
}
|
||||
|
||||
|
||||
// Add the dropdown to the container
|
||||
backgroundMusicContainer.addChild(dropdown);
|
||||
|
||||
// Adjust the dropdown's popup container size if necessary
|
||||
Vector3f dimens = settingsContainer.getPreferredSize();
|
||||
Vector3f dimens2 = dropdown.getPopupContainer().getPreferredSize();
|
||||
dimens2.setX(dimens.getX());
|
||||
dropdown.getPopupContainer().setPreferredSize(dimens2);
|
||||
// Beenden-Button
|
||||
Button quitButton = settingsContainer.addChild(new Button("Beenden", new ElementId("menu-button")));
|
||||
quitButton.setFontSize(32);
|
||||
|
Reference in New Issue
Block a user