如何在 libgdx 中更改文本字段字体的大小?
How can I change the size of textfield font in libgdx?
UserNameTextField = new TextField("", GlobalSKin);
UserNameTextField. ???
您可以调用各种内置方法来设置大小.如果您只想设置文本字段的大小,您可以调用
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);
`
你可以检查所有方法,只需要看看API.
You can check all methods , just need to take a look at API.
这篇关于文本字段 libgdx 中的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!