I am using BitmapFonts, LabelStyles and Labels for my texts.
I want to resize some labels, so I use this:
fontType.scale(-.6f);
LabelStyle style = new LabelStyle(fontType, Color.WHITE);
titleLabel = new Label("Points", style);
titleLabel.setColor(Color.RED);
titleLabel.x = 260;
titleLabel.y = 310;
But when I want to resize another label, all the labels containing that font resize (I create a new LabelStyle). So I resize the label instead of the font, but that doesnt solve the problem, because it doesnt resize the label, any idea?
You will have to create separate BitmapFonts and LabelStyle for each Label(or groups of Labels) if you want to scale them independently.
From checking libgdx source code, Label uses the reference to BitmapFont from LabelStyle and passes it to a BitmapFontCache used internally; no deep copy is made at any point so they are all using the same BitmapFont you created the LabelStyle with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With