mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-24 22:49:44 +01:00
Anpassung des Button designs
This commit is contained in:
parent
2e0d1c059d
commit
8ab37e73c1
@ -1,6 +1,7 @@
|
||||
package pp.monopoly.client;
|
||||
|
||||
import com.jme3.material.Material;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.scene.Geometry;
|
||||
import com.jme3.scene.shape.Quad;
|
||||
@ -10,6 +11,7 @@ import com.simsilica.lemur.Button;
|
||||
import com.simsilica.lemur.Container;
|
||||
import com.simsilica.lemur.HAlignment;
|
||||
import com.simsilica.lemur.Label;
|
||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
|
||||
import com.simsilica.lemur.component.SpringGridLayout;
|
||||
|
||||
import pp.dialog.Dialog;
|
||||
@ -57,6 +59,15 @@ public class StartMenu extends Dialog {
|
||||
startButton.setPreferredSize(new Vector3f(190, 60, 0)); // Increase button size (width, height)
|
||||
startButton.setFontSize(40); // Set the font size for the button text
|
||||
startButton.setTextHAlignment(HAlignment.Center); // Center the text horizontally
|
||||
|
||||
// Set a custom border and background color
|
||||
ColorRGBA borderColor = ColorRGBA.Orange; // Example: White border
|
||||
ColorRGBA backgroundColor = ColorRGBA.LightGray; // Example: light gray background
|
||||
QuadBackgroundComponent backgroundColorSp = new QuadBackgroundComponent(backgroundColor);
|
||||
backgroundColorSp.setMargin(2, 2); // Optional: Adjust margin for the border
|
||||
backgroundColorSp.setColor(borderColor); // Set border color
|
||||
startButton.setBackground(backgroundColorSp);
|
||||
|
||||
startButton.addClickCommands(source -> startGame(app));
|
||||
centerMenu.addChild(startButton);
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 857 KiB |
Loading…
Reference in New Issue
Block a user