mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-07-31 06:47:41 +02:00
Gui v1.0
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// Styling of Lemur components
|
||||
// For documentation, see:
|
||||
// https://github.com/jMonkeyEngine-Contributions/Lemur/wiki/Styling
|
||||
|
||||
import com.jme3.math.ColorRGBA
|
||||
import com.simsilica.lemur.*
|
||||
import com.simsilica.lemur.component.QuadBackgroundComponent
|
||||
import com.simsilica.lemur.Button
|
||||
@@ -19,7 +21,11 @@ def sliderColor = color(0.6, 0.8, 0.8, 1)
|
||||
def sliderBgColor = color(0.5, 0.75, 0.75, 1)
|
||||
def gradientColor = color(0.5, 0.75, 0.85, 0.5)
|
||||
def tabbuttonEnabledColor = color(0.4, 0.45, 0.5, 1)
|
||||
def solidWhiteBackground = new QuadBackgroundComponent(color(1, 1, 1, 1)) // Solid white
|
||||
def solidWhiteBackground = new QuadBackgroundComponent(new ColorRGBA(1, 1, 1, 1))
|
||||
def greyBackground = new QuadBackgroundComponent(new ColorRGBA(0.1f, 0.1f, 0.1f, 1.0f));
|
||||
def lightGreyBackground = new QuadBackgroundComponent(new ColorRGBA(0.4f, 0.4f, 0.4f, 1.0f));
|
||||
def lightGrey = color(0.6, 0.6, 0.6, 1.0)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,9 +38,10 @@ def gradient = TbtQuadBackgroundComponent.create(
|
||||
def doubleGradient = new QuadBackgroundComponent(gradientColor)
|
||||
doubleGradient.texture = texture(name: "/com/simsilica/lemur/icons/double-gradient-128.png",
|
||||
generateMips: false)
|
||||
//doubleGradient.color = color(0, 0, 0, 1)
|
||||
|
||||
def orangeBorder = TbtQuadBackgroundComponent.create(
|
||||
texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png", // Replace with an appropriate texture if needed
|
||||
texture(name: "/com/simsilica/lemur/icons/border.png", // Replace with an appropriate texture if needed
|
||||
generateMips: false),
|
||||
1, 1, 1, 126, 126,
|
||||
1f, false)
|
||||
@@ -49,11 +56,27 @@ selector("label", "pp") {
|
||||
color = buttonEnabledColor
|
||||
}
|
||||
|
||||
selector("label-Bold", "pp") {
|
||||
insets = new Insets3f(2, 2, 2, 2)
|
||||
font = font("Interface/Fonts/Metropolis/Metropolis-Bold-32.fnt")
|
||||
fontSize = 30
|
||||
color = buttonEnabledColor
|
||||
textHAlignment = HAlignment.Center
|
||||
textVAlignment = VAlignment.Center
|
||||
|
||||
}
|
||||
selector("label-Text", "pp") {
|
||||
insets = new Insets3f(2, 2, 2, 2)
|
||||
fontSize = 25
|
||||
color = buttonEnabledColor
|
||||
}
|
||||
|
||||
selector("header", "pp") {
|
||||
font = font("Interface/Fonts/Metropolis/Metropolis-Bold-42.fnt")
|
||||
insets = new Insets3f(2, 2, 2, 2)
|
||||
color = color(1, 0.5, 0, 1)
|
||||
textHAlignment = HAlignment.Center
|
||||
textVAlignment = VAlignment.Center
|
||||
}
|
||||
|
||||
selector("container", "pp") {
|
||||
@@ -62,20 +85,10 @@ selector("container", "pp") {
|
||||
}
|
||||
|
||||
selector("toolbar") {
|
||||
// Set the grey background
|
||||
background = new QuadBackgroundComponent(greyBackground)
|
||||
background = gradient.clone()
|
||||
background.setColor(bgColor)
|
||||
//color = (new ColorRGBA(0.4157f, 0.4235f, 0.4392f, 1.0f))
|
||||
|
||||
// Add a red border using a TbtQuadBackgroundComponent
|
||||
def redBorder = TbtQuadBackgroundComponent.create(
|
||||
texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png",
|
||||
generateMips: false),
|
||||
1, 1, 1, 1, 1,
|
||||
1f, false)
|
||||
redBorder.color = redBorderColor
|
||||
background = greyBackground
|
||||
|
||||
// Optional: Set padding inside the toolbar
|
||||
insets = new Insets3f(10, 10, 10, 10)
|
||||
}
|
||||
selector("slider", "pp") {
|
||||
background = gradient.clone()
|
||||
@@ -144,6 +157,8 @@ selector("title", "pp") {
|
||||
background.texture = texture(name: "/com/simsilica/lemur/icons/double-gradient-128.png",
|
||||
generateMips: false)
|
||||
insets = new Insets3f(2, 2, 2, 2)
|
||||
textHAlignment = HAlignment.Center
|
||||
textVAlignment = VAlignment.Center
|
||||
|
||||
buttonCommands = stdButtonCommands
|
||||
}
|
||||
@@ -158,6 +173,8 @@ selector("button", "pp") {
|
||||
|
||||
// Use insets to create a margin/padding effect for the inner background
|
||||
insets = new Insets3f(3, 3, 3, 3) // Adjust the border thickness
|
||||
textHAlignment = HAlignment.Center
|
||||
textVAlignment = VAlignment.Center
|
||||
buttonCommands = stdButtonCommands
|
||||
}
|
||||
|
||||
@@ -231,6 +248,47 @@ selector("tab.button", "pp") {
|
||||
buttonCommands = stdButtonCommands
|
||||
}
|
||||
selector("settings-title", "pp") {
|
||||
fontSize = 48 // Set font size
|
||||
background = new QuadBackgroundComponent(color(0.4157f, 0.4235f, 0.4392f, 1.0f)) // Grey background
|
||||
}
|
||||
def outerBackground = new QuadBackgroundComponent(color(1, 0.5, 0, 1)) // Grey inner border
|
||||
def innerBackground = new QuadBackgroundComponent(buttonBgColor) // White outer border background
|
||||
|
||||
background = outerBackground
|
||||
fontSize = 40
|
||||
insets = new Insets3f(3, 3, 3, 3)
|
||||
textHAlignment = HAlignment.Center
|
||||
textVAlignment = VAlignment.Center
|
||||
}
|
||||
|
||||
selector("menu-button", "pp") {
|
||||
fontSize = 40 // Set font size
|
||||
textHAlignment = HAlignment.Center
|
||||
textVAlignment = VAlignment.Center
|
||||
buttonCommands = stdButtonCommands
|
||||
}
|
||||
|
||||
// Style for Selector text
|
||||
selector("selector.item.label") {
|
||||
color = color(0, 0, 0, 1) // Black text
|
||||
fontSize = 16 // Optional: Adjust the text size if needed
|
||||
textHAlignment = HAlignment.Left // Optional: Align text to the left
|
||||
insets = new Insets3f(2, 2, 2, 2) // Optional: Add padding around text
|
||||
}
|
||||
// Style the popup container background
|
||||
selector("selector.popup") {
|
||||
background = new QuadBackgroundComponent(new ColorRGBA(1, 1, 1, 0.8f)) // Translucent white background
|
||||
insets = new Insets3f(5, 5, 5, 5) // Padding inside the popup container
|
||||
}
|
||||
|
||||
// Style the text of dropdown options
|
||||
selector("selector.item.label") {
|
||||
color = color(0, 0, 0, 1) // Black text
|
||||
fontSize = 16 // Optional: Adjust font size
|
||||
textHAlignment = HAlignment.Left // Align text to the left
|
||||
insets = new Insets3f(2, 5, 2, 5) // Add padding for each option
|
||||
}
|
||||
|
||||
// Style the hover state of dropdown options
|
||||
selector("selector.item.label", "hover") {
|
||||
color = color(1, 1, 1, 1) // White text when hovered
|
||||
background = new QuadBackgroundComponent(new ColorRGBA(0.2f, 0.6f, 1.0f, 0.9f)) // Highlighted background
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user