Compare commits

...

2 Commits

Author SHA1 Message Date
Yvonne Schmidt
c758ba9735 corrected toolbar labels 2024-12-08 15:05:47 +01:00
Yvonne Schmidt
650dcb85db toolbar frame has playercolor 2024-12-08 14:53:41 +01:00
2 changed files with 21 additions and 21 deletions

View File

@ -87,7 +87,7 @@ selector("label-Bold", "pp") {
selector("label-toolbar", "pp") { selector("label-toolbar", "pp") {
insets = new Insets3f(2, 2, 2, 2) insets = new Insets3f(2, 2, 2, 2)
font = font("Interface/Fonts/Metropolis/Metropolis-Bold-32.fnt") font = font("Interface/Fonts/Metropolis/Metropolis-Bold-32.fnt")
fontSize = 30 fontSize = 25
color = new ColorRGBA(ColorRGBA.White) color = new ColorRGBA(ColorRGBA.White)
textHAlignment = HAlignment.Center textHAlignment = HAlignment.Center
textVAlignment = VAlignment.Center textVAlignment = VAlignment.Center

View File

@ -156,30 +156,28 @@ public class Toolbar extends Dialog implements GameEventListener {
// Oberer Balken mit der Spielerfarbe // Oberer Balken mit der Spielerfarbe
Container playerColorBar = new Container(); Container playerColorBar = new Container();
playerColorBar.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 5, 0)); // Höhe des oberen Balkens playerColorBar.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 5, 0)); // Höhe des oberen Balkens
playerColorBar.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray)); playerColorBar.setBackground(new QuadBackgroundComponent(currentPlayerColor.getColor())); // Use player color
playerColorBar.setLocalTranslation(0, 205, 3); // Position über der Toolbar playerColorBar.setLocalTranslation(0, 205, 3); // Position über der Toolbar
app.getGuiNode().attachChild(playerColorBar); app.getGuiNode().attachChild(playerColorBar);
// Unterer Balken mit der Spielerfarbe
// unterer Balken
Container playerColorBarbot = new Container(); Container playerColorBarbot = new Container();
playerColorBarbot.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 10, 0)); // Höhe des oberen Balkens playerColorBarbot.setPreferredSize(new Vector3f(app.getCamera().getWidth(), 10, 0)); // Höhe des unteren Balkens
playerColorBarbot.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray)); playerColorBarbot.setBackground(new QuadBackgroundComponent(currentPlayerColor.getColor())); // Use player color
playerColorBarbot.setLocalTranslation(0, 5, 3); // Position über der Toolbar playerColorBarbot.setLocalTranslation(0, 5, 3); // Position über der Toolbar
app.getGuiNode().attachChild(playerColorBarbot); app.getGuiNode().attachChild(playerColorBarbot);
// Linker Balken mit der Spielerfarbe
// Linker Balken
Container leftBar = new Container(); Container leftBar = new Container();
leftBar.setPreferredSize(new Vector3f(5, 210, 0)); // Breite 10, Höhe 210 leftBar.setPreferredSize(new Vector3f(5, 210, 0)); // Breite 5, Höhe 210
leftBar.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray)); leftBar.setBackground(new QuadBackgroundComponent(currentPlayerColor.getColor())); // Use player color
leftBar.setLocalTranslation(0, 200, 3); // Position am linken Rand leftBar.setLocalTranslation(0, 200, 3); // Position am linken Rand
app.getGuiNode().attachChild(leftBar); app.getGuiNode().attachChild(leftBar);
// Rechter Balken // Rechter Balken mit der Spielerfarbe
Container rightBar = new Container(); Container rightBar = new Container();
rightBar.setPreferredSize(new Vector3f(5, 210, 0)); // Breite 10, Höhe 210 rightBar.setPreferredSize(new Vector3f(5, 210, 0)); // Breite 5, Höhe 210
rightBar.setBackground(new QuadBackgroundComponent(ColorRGBA.DarkGray)); rightBar.setBackground(new QuadBackgroundComponent(currentPlayerColor.getColor())); // Use player color
rightBar.setLocalTranslation(app.getCamera().getWidth() - 5, 200, 2); // Position am rechten Rand rightBar.setLocalTranslation(app.getCamera().getWidth() - 5, 200, 2); // Position am rechten Rand
app.getGuiNode().attachChild(rightBar); app.getGuiNode().attachChild(rightBar);
@ -513,6 +511,8 @@ public class Toolbar extends Dialog implements GameEventListener {
// Farbe setzen // Farbe setzen
playerLabel.setColor(playerColor); playerLabel.setColor(playerColor);
playerLabel.setFontSize(20);
// Label zum Container hinzufügen // Label zum Container hinzufügen
overviewContainer.addChild(playerLabel); overviewContainer.addChild(playerLabel);
} }