// Styling of Lemur components // For documentation, see: // https://github.com/jMonkeyEngine-Contributions/Lemur/wiki/Styling import com.simsilica.lemur.* import com.simsilica.lemur.component.QuadBackgroundComponent import com.simsilica.lemur.Button import com.simsilica.lemur.Button.ButtonAction import com.simsilica.lemur.Command import com.simsilica.lemur.HAlignment import com.simsilica.lemur.Insets3f import com.simsilica.lemur.component.QuadBackgroundComponent import com.simsilica.lemur.component.TbtQuadBackgroundComponent def bgColor = color(1, 1, 1, 1) def buttonEnabledColor = color(0, 0, 0, 1) def buttonDisabledColor = color(0.8, 0.9, 1, 0.2) def buttonBgColor = color(1, 1, 1, 1) 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 greyBackground = color(0.8, 0.8, 0.8, 1) // Grey background color def redBorderColor = color(1, 0, 0, 1) // Red border color def gradient = TbtQuadBackgroundComponent.create( texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png", generateMips: false), 1, 1, 1, 126, 126, 1f, false) def doubleGradient = new QuadBackgroundComponent(gradientColor) doubleGradient.texture = texture(name: "/com/simsilica/lemur/icons/double-gradient-128.png", generateMips: false) def orangeBorder = TbtQuadBackgroundComponent.create( texture(name: "/com/simsilica/lemur/icons/bordered-gradient.png", // Replace with an appropriate texture if needed generateMips: false), 1, 1, 1, 126, 126, 1f, false) orangeBorder.color = color(1, 0.5, 0, 1) // Orange color selector("pp") { font = font("Interface/Fonts/Metropolis/Metropolis-Regular-32.fnt") } selector("label", "pp") { insets = new Insets3f(2, 2, 2, 2) 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 } selector("container", "pp") { background = solidWhiteBackground.clone() background.setColor(bgColor) } selector("toolbar") { // Set the grey background background = new QuadBackgroundComponent(greyBackground) // 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() background.setColor(bgColor) } def pressedCommand = new Command