So, I have this code:
QuadBackgroundComponent bg = new QuadBackgroundComponent(ColorRGBA.Blue);
TbtQuadBackgroundComponent realbg = TbtQuadBackgroundComponent.create(assetManager.loadTexture("Textures/test9patchtex.png"), 1, 10,10, 229,229,0,false);
TbtQuadBackgroundComponent realborder = TbtQuadBackgroundComponent.create(assetManager.loadTexture("Textures/inflicted.png"), 1, 10,10, 229,229,0,false);
attrs = styles.getSelector(null);
attrs.set("fontSize", 40);
attrs.set("border", realbg);
attrs.set("background", realborder);
attrs.set("insets", new Insets3f(15f, 15f, 15f, 15f));
Container titleWindow = new Container();
guiNode.attachChild(titleWindow);
titleWindow.setLocalTranslation(40, 450, 0);
Label title = new Label("Realm Racer");
System.out.println(title.getElementId().toString());
titleWindow.addChild(title);
Container playWindow = new Container();
guiNode.attachChild(playWindow);
playWindow.setLocalTranslation(500, 400, 0);
Button play = new Button("Play");
play.addClickCommands(new Command<Button>(){
@Override
public void execute(Button source){
System.out.println("PLAY PLAY PLAY");
}
});
playWindow.addChild(play);
Essentially, i have a 9 patch scaling applied to both border and background textures, and apply them to a label and a button. The output becomes this:
However, if I change the Label to a Button, it works as expected:
Why? Am I missing something about the layer construction of a label versus a button (besides a default background)?
@pspeed I’ll be trying to create a gui over the next couple of weeks, so you better be prepared for a storm of questions