Also, hereās most of Lemurās glass style, written in Java:
public static void loadGlassStyle(Application app) {
GuiGlobals.initialize(app);
////
Styles styles = GuiGlobals.getInstance().getStyles();
Attributes attrs;
TbtQuadBackgroundComponent gradient = TbtQuadBackgroundComponent.create(
app.getAssetManager().loadTexture("/com/simsilica/lemur/icons/bordered-gradient.png"),
1f, 1, 1, 126, 126,
1f, false);
TbtQuadBackgroundComponent bevel = TbtQuadBackgroundComponent.create(
app.getAssetManager().loadTexture("/com/simsilica/lemur/icons/bevel-quad.png"),
1f, 1, 1, 126, 126,
1f, false);
TbtQuadBackgroundComponent border = TbtQuadBackgroundComponent.create(
app.getAssetManager().loadTexture("/com/simsilica/lemur/icons/border.png"),
1f, 1, 1, 126, 126,
1f, false);
TbtQuadBackgroundComponent border2 = TbtQuadBackgroundComponent.create(
app.getAssetManager().loadTexture("/com/simsilica/lemur/icons/border.png"),
1f, 1, 1, 126, 126,
1f, false);
QuadBackgroundComponent doubleGradient = new QuadBackgroundComponent(new ColorRGBA(.5f, .75f, .85f, .5f));
doubleGradient.setTexture(app.getAssetManager().loadTexture("/com/simsilica/lemur/icons/double-gradient-128.png"));
attrs = styles.getSelector("glass");
attrs.set("fontSize", 24);
attrs = styles.getSelector("label", "glass");
attrs.set("insets", new Insets3f(2, 2, 0, 2));
attrs.set("color", new ColorRGBA(0.5f, 0.75f, 0.75f, 0.85f));
attrs = styles.getSelector("container", "glass");
TbtQuadBackgroundComponent gradient_clone_container = gradient.clone();
gradient_clone_container.setColor(new ColorRGBA(.25f, .5f, .5f, .5f));
attrs.set("background", gradient_clone_container);
Command<Button> pressedCommand = new Command<Button>() {
@Override
public void execute(Button source) {
if(source.isPressed()) {
source.move(1, -1, 0);
} else {
source.move(-1, 1, 0);
}
}
};
Map<ButtonAction, List<Command<? super Button>>> stdButtonCommands = new HashMap<>();
List<Command<? super Button>> listButtonCommands = new ArrayList<>();
listButtonCommands.add(pressedCommand);
stdButtonCommands.put(ButtonAction.Down, listButtonCommands);
stdButtonCommands.put(ButtonAction.Up, listButtonCommands);
// selector( ātitleā, āglassā ) {
// color = color(0.8, 0.9, 1, 0.85f)
// highlightColor = color(1, 0.8, 1, 0.85f)
// shadowColor = color(0, 0, 0, 0.75f)
// shadowOffset = new com.jme3.math.Vector3f(2, -2, -1);
// background = new QuadBackgroundComponent( color(0.5, 0.75, 0.85, 0.5) );
// background.texture = texture( name:ā/com/simsilica/lemur/icons/double-gradient-128.pngā,
// generateMips:false )
// insets = new Insets3f( 2, 2, 2, 2 );
//
// buttonCommands = stdButtonCommands;
// }
attrs = styles.getSelector("title", "glass");
attrs = styles.getSelector("button", "glass");
TbtQuadBackgroundComponent gradient_clone_button = gradient.clone();
gradient_clone_button.setColor(new ColorRGBA(0, .75f, .75f, .5f));
attrs.set("background", gradient_clone_button);
attrs.set("color", new ColorRGBA(.8f, .9f, 1f, .85f));
attrs.set("insets", new Insets3f(2, 2, 2, 2));
attrs.set("buttonCommands", stdButtonCommands);
////
styles.setDefaultStyle("glass");
}
ā¦ I wrote this a while back ago, but it should work