I want to change the background style of only one label, which is in its own table, and it has its own layer, which is added on top of the others on the stack. However, when I assign it, ALL Labels, in all other layers of other tables, also gets this background. I do not understand why this will happen. I am using libgdx 0.9.8. Created by skinLibgdx uses basic png with fonts and small background images (from which "white" appears).
lblGameMessage = new Label(" ", skinLibgdx.get(LabelStyle.class));
...
lblGameMessage.getStyle().background = skinLibgdx.newDrawable("white", 0.2f, 0.2f, 0.2f, 0.8f);
This is mistake? Why will all other tags be affected by this? After this line, I try to set other shortcuts back to black, but then my lblGameMessage also turns black.
lblLevel = new Label("Level: ", skinLibgdx.get(LabelStyle.class));
...
lblLevel.getStyle().background = skinLibgdx.newDrawable("white", 0, 0, 0, 1);
source
share