Deckhelper korrigiert

This commit is contained in:
Simon Wilkening 2024-11-25 06:30:04 +01:00
parent 88409dcc99
commit 16b4dbae18

View File

@ -5,12 +5,10 @@ import java.util.Random;
import com.jme3.font.BitmapText;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.simsilica.lemur.Axis;
import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label;
import com.simsilica.lemur.Panel;
import com.simsilica.lemur.*;
import com.simsilica.lemur.component.IconComponent;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import com.simsilica.lemur.component.SpringGridLayout;
@ -39,7 +37,6 @@ public class Toolbar extends Dialog {
* Konstruktor für die Toolbar.
*
* @param app Die Hauptanwendung (MonopolyApp)
* @param cube Der Würfel, der bewegt werden soll
*/
public Toolbar(MonopolyApp app) {
super(app.getDialogManager());
@ -95,14 +92,34 @@ public class Toolbar extends Dialog {
// Create the first container (leftContainer)
Container leftContainer = new Container();
leftContainer.setPreferredSize(new Vector3f(100, 150, 0)); // Adjust size as needed
leftContainer.addChild(new Label("Left Container", new ElementId("label")));
leftContainer.addChild(new Button("Button 1"));
Label imageLabel = new Label("");
IconComponent icon = new IconComponent("Pictures/dice/one.png"); // Icon mit Textur erstellen
icon.setIconSize(new Vector2f(100,100)); // Skalierung des Bildes
imageLabel.setIcon(icon);
Label imageLabel2 = new Label("");
IconComponent icon2 = new IconComponent("Pictures/dice/two.png"); // Icon mit Textur erstellen
icon2.setIconSize(new Vector2f(100,100)); // Skalierung des Bildes
imageLabel2.setIcon(icon2);
// Create the second container (rightContainer)
Container rightContainer = new Container();
rightContainer.setPreferredSize(new Vector3f(100, 150, 0)); // Adjust size as needed
rightContainer.addChild(new Label("Right Container", new ElementId("label")));
rightContainer.addChild(new Button("Button 2"));
leftContainer.setBackground(null);
rightContainer.setBackground(null);
diceContainer.setBackground(null);
horizontalContainer.setBackground(null);
imageLabel.setTextVAlignment(VAlignment.Center);
imageLabel.setTextHAlignment(HAlignment.Center);
imageLabel2.setTextVAlignment(VAlignment.Center);
imageLabel2.setTextHAlignment(HAlignment.Center);
leftContainer.addChild(imageLabel);
rightContainer.addChild(imageLabel2);
// Add leftContainer and rightContainer to the horizontal container
horizontalContainer.addChild(leftContainer);