ImageTextButton中的文本在更高分辨率的设备上更大

时间:2015-12-28 10:31:15

标签: libgdx

我在指定ImageTextButton中的文本大小时遇到​​了一些麻烦。我没有找到任何方法或属性来定义文本大小。我使用下面的代码,但文本非常小。我希望文本在更高分辨率的设备上更大,因为我的所有代码都与屏幕尺寸有关。位图字体是正确的方法吗? ImageTextButton中的一个代码文本如何在更大的设备上变大?

            font = new BitmapFont(Gdx.files.internal("font.fnt"));
            ImageTextButton.ImageTextButtonStyle bts = new ImageTextButton.ImageTextButtonStyle();
            bts.up = ninePatchDrawable;
            bts.font=font;

            bts.fontColor= Color.WHITE;
            checkButton=new ImageTextButton("Text",bts);
            checkButton.setBounds(Gdx.graphics.getWidth() * 0.2f, Gdx.graphics.getHeight() * 0.01f,Gdx.graphics.getWidth() * 0.24f,Gdx.graphics.getHeight()*0.08f);

            stage.addActor(checkButton);

1 个答案:

答案 0 :(得分:0)

原来我必须为谷歌搜索选择不同的关键字。这解决了我的问题How to draw smooth text in libgdx?

相关问题