BitmapFont class 没有 getBound(String) 方法
BitmapFont class does not have getBound(String) method
之前我在libgdx[=中为BitmapFontclass使用了getBound方法21=],但是现在,我无法使用它。
我找不到最新版本的变化。
感谢任何帮助。谢谢
在 API 1.5.6
之后,我们有一种不同的方法来绑定字符串。试试这个
GlyphLayout layout = new GlyphLayout();
layout.setText(bitmapFont,"text");
float width = layout.width;
float height = layout.height;
而且不建议每帧都新建GlyphLayout
,创建一次就用。
之前我在libgdx[=中为BitmapFontclass使用了getBound方法21=],但是现在,我无法使用它。
我找不到最新版本的变化。
感谢任何帮助。谢谢
在 API 1.5.6
之后,我们有一种不同的方法来绑定字符串。试试这个
GlyphLayout layout = new GlyphLayout();
layout.setText(bitmapFont,"text");
float width = layout.width;
float height = layout.height;
而且不建议每帧都新建GlyphLayout
,创建一次就用。