Erick Voodoo
Erick Voodoo

Reputation: 326

Font size in textfield libgdx

How can I change the size of textfield font in libgdx?

UserNameTextField = new TextField("", GlobalSKin);
UserNameTextField. ???

Upvotes: 0

Views: 1366

Answers (1)

Aiman Batul
Aiman Batul

Reputation: 144

There are various builtin methods you can call to set size. If you just want to set the size of textfield you can call

UserNameTextField.setWidth(float width) Or UserNameTextField.setHeight(float width) or UserNameTextField.setMaxLength(maxLength)

And if you only want to set size of font then do it like `

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

`

You can check all methods , just need to take a look at API.

Upvotes: 1

Related Questions