mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 00:06:16 +01:00
replaced text displays with labels
This commit is contained in:
parent
5f4c6be7b8
commit
944b6b674e
@ -3,6 +3,7 @@
|
||||
// https://github.com/jMonkeyEngine-Contributions/Lemur/wiki/Styling
|
||||
|
||||
import com.jme3.math.ColorRGBA
|
||||
import com.jme3.texture.Texture
|
||||
import com.simsilica.lemur.*
|
||||
import com.simsilica.lemur.component.QuadBackgroundComponent
|
||||
import com.simsilica.lemur.Button
|
||||
@ -47,6 +48,23 @@ def orangeBorder = TbtQuadBackgroundComponent.create(
|
||||
1f, false)
|
||||
orangeBorder.color = color(1, 0.5, 0, 1) // Orange color
|
||||
|
||||
|
||||
def createCustomBackground(app) {
|
||||
// Load the texture from the assets
|
||||
Texture texture = app.getAssetManager().loadTexture("Pictures/kontobg.png")
|
||||
|
||||
// Create the TbtQuadBackgroundComponent
|
||||
def backgroundCustom = TbtQuadBackgroundComponent.create(
|
||||
texture, // The texture to use
|
||||
1, 1, 1, // Insets for the 9-patch behavior
|
||||
126, 126, // The size of the texture
|
||||
1f, // The scale factor
|
||||
false // No tiling
|
||||
)
|
||||
|
||||
return backgroundCustom
|
||||
}
|
||||
|
||||
selector("pp") {
|
||||
font = font("Interface/Fonts/Metropolis/Metropolis-Regular-32.fnt")
|
||||
}
|
||||
@ -366,3 +384,12 @@ selector("button-toolbar", "pp") {
|
||||
}
|
||||
|
||||
|
||||
selector("button-toolbar2", "pp") {
|
||||
insets = new Insets3f(3, 3, 3, 3) // Adjust the border thickness
|
||||
textHAlignment = HAlignment.Center
|
||||
textVAlignment = VAlignment.Center
|
||||
buttonCommands = stdButtonCommandsToolbar
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -257,7 +257,7 @@ public class Toolbar extends Dialog implements GameEventListener {
|
||||
}
|
||||
|
||||
private Button createPropertyMenuButton() {
|
||||
propertyMenuButton = new Button("", new ElementId("button-toolbar"));
|
||||
propertyMenuButton = new Button("", new ElementId("button-toolbar2"));
|
||||
propertyMenuButton.setPreferredSize(new Vector3f(150, 50, 0));
|
||||
|
||||
String iconBuildingPath = "icons/icon-gebaude.png";
|
||||
|
@ -40,8 +40,8 @@ public class BuyHouse extends Dialog {
|
||||
/** Background container providing a border for the popup. */
|
||||
private final Container backgroundContainer;
|
||||
|
||||
/** TextField to display selected properties. */
|
||||
private TextField selectionDisplay;
|
||||
/** Label to display selected properties. */
|
||||
private Label selectionDisplay;
|
||||
|
||||
/** Reference for tracking dropdown selection changes. */
|
||||
private VersionedReference<Set<Integer>> selectionRef;
|
||||
@ -162,7 +162,7 @@ public class BuyHouse extends Dialog {
|
||||
selectionRef = propertySelector.getSelectionModel().createReference();
|
||||
|
||||
// Initialize the selection display here
|
||||
selectionDisplay = new TextField(""); // Create TextField for displaying selections
|
||||
selectionDisplay = new Label("");
|
||||
selectionDisplay.setPreferredSize(new Vector3f(300, 30, 0));
|
||||
dropdownContainer.addChild(selectionDisplay); // Add it to the dropdown container
|
||||
|
||||
|
@ -45,8 +45,8 @@ public class RepayMortage extends Dialog {
|
||||
/** Background container providing a border for the popup. */
|
||||
private final Container backgroundContainer;
|
||||
|
||||
/** Text field to display selected properties. */
|
||||
private TextField selectionDisplay;
|
||||
/** Label to display selected properties. */
|
||||
private Label selectionDisplay;
|
||||
|
||||
/** Reference to track property selections in the dropdown menu. */
|
||||
private VersionedReference<Set<Integer>> selectionRef;
|
||||
@ -166,7 +166,7 @@ public class RepayMortage extends Dialog {
|
||||
selectionRef = propertySelector.getSelectionModel().createReference();
|
||||
|
||||
// Initialize the selection display here
|
||||
selectionDisplay = new TextField(""); // Create TextField for displaying selections
|
||||
selectionDisplay = new Label(""); // Create TextField for displaying selections
|
||||
selectionDisplay.setPreferredSize(new Vector3f(300, 30, 0));
|
||||
dropdownContainer.addChild(selectionDisplay); // Add it to the dropdown container
|
||||
|
||||
|
@ -45,8 +45,8 @@ public class SellHouse extends Dialog {
|
||||
/** Background container providing a styled border around the main dialog. */
|
||||
private final Container backgroundContainer;
|
||||
|
||||
/** Text field to display selected properties. */
|
||||
private TextField selectionDisplay;
|
||||
/** Label to display selected properties. */
|
||||
private Label selectionDisplay;
|
||||
|
||||
/** Reference to track selection changes in the property selector. */
|
||||
private VersionedReference<Set<Integer>> selectionRef;
|
||||
@ -86,7 +86,7 @@ public class SellHouse extends Dialog {
|
||||
title.setFontSize(48);
|
||||
title.setColor(ColorRGBA.Black);
|
||||
|
||||
//Unterteilund des sellHouseContainer in drei "Untercontainer"
|
||||
//Unterteilung des sellHouseContainer in drei "Untercontainer"
|
||||
Container upContainer = sellhouseContainer.addChild(new Container());
|
||||
Container middleContainer = sellhouseContainer.addChild(new Container());
|
||||
Container downContainer = sellhouseContainer.addChild(new Container());
|
||||
@ -172,7 +172,7 @@ public class SellHouse extends Dialog {
|
||||
selectionRef = propertySelector.getSelectionModel().createReference();
|
||||
|
||||
// Initialize the selection display here
|
||||
selectionDisplay = new TextField(""); // Create TextField for displaying selections
|
||||
selectionDisplay = new Label("");
|
||||
selectionDisplay.setPreferredSize(new Vector3f(300, 30, 0));
|
||||
dropdownContainer.addChild(selectionDisplay); // Add it to the dropdown container
|
||||
|
||||
|
@ -46,8 +46,8 @@ public class TakeMortage extends Dialog {
|
||||
/** Background container providing a styled border around the main dialog. */
|
||||
private final Container backgroundContainer;
|
||||
|
||||
/** Text field to display selected properties. */
|
||||
private TextField selectionDisplay;
|
||||
/** Label to display selected properties. */
|
||||
private Label selectionDisplay;
|
||||
|
||||
/** Reference to track selection changes in the property selector. */
|
||||
private VersionedReference<Set<Integer>> selectionRef;
|
||||
@ -172,7 +172,7 @@ public class TakeMortage extends Dialog {
|
||||
selectionRef = propertySelector.getSelectionModel().createReference();
|
||||
|
||||
// Initialize the selection display here
|
||||
selectionDisplay = new TextField(""); // Create TextField for displaying selections
|
||||
selectionDisplay = new Label(""); // Create TextField for displaying selections
|
||||
selectionDisplay.setPreferredSize(new Vector3f(300, 30, 0));
|
||||
dropdownContainer.addChild(selectionDisplay); // Add it to the dropdown container
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user