textfield libgdx中的字体大小 [英] Font size in textfield libgdx

查看:106
本文介绍了textfield libgdx中的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改libgdx中textfield字体的大小?

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.

这篇关于textfield libgdx中的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆