I am working on a school project, in it we are making a game. My issue is with Labels inside an Observer in a Observer/Observable pair. The Observer, called ScoreView, builds the Labels in its Constructor. And a function called update modifies the values whenever they change inside the Observable.
// Inside the constructor. PADDING = 5, increasing or decreasing does not help
// ...
damage = new Label("Player Damage Level:");
damageVal = new Label();
damageVal.getAllStyles().setPadding(Form.LEFT, PADDING);
damageVal.getAllStyles().setPadding(Form.RIGHT, PADDING);
// ...
north.add(damage);
north.add(damageVal);
// inside the update file
damageVal.setText(Integer.toString(gw.getDamageLevel()));
Initially the value is 0, and the damage goes up in increments of 20. So I end up seeing "Player Damage Level: 0", "....: 2", ".....: 4". When it should be 20, 40, 60, etc. Values that go down, say the fuel level going from 100 and lower, is all fine. As the text gets longer it gets cut off. How do I fix that.
Thank you