Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libgdx textfield: how to set font size?

Tags:

libgdx

Here

TextField.TextFieldStyle textFieldStyle = skin.get(TextField.TextFieldStyle.class);
textFieldStyle.font.scale(1.6f);

I can't find font.scale();

my code

username = new TextField("", skin);
username.setMessageText("");
like image 798
Lynob Avatar asked Sep 15 '25 21:09

Lynob


1 Answers

You need to get the data from the font first, then you can set the scale. But the recommended way is to create different sizes of the same font.

font.getData().setScale(1.0f);

Here is a link to same question Changing font size in skin

like image 188
JohannesAndersson Avatar answered Sep 19 '25 15:09

JohannesAndersson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!