【问题标题】:text in ImageTextButton bigger on higher resolution devicesImageTextButton 中的文本在更高分辨率的设备上更大
【发布时间】:2016-04-02 04:52:26
【问题描述】:

我在指定 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);

【问题讨论】:

  • 我很难理解视口的概念。我最终使用了相对布局,到目前为止它们工作得很好。

标签: libgdx


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2015-12-03
    • 1970-01-01
    • 1970-01-01
    • 2021-10-17
    • 1970-01-01
    • 1970-01-01
    • 2017-03-09
    • 2019-03-15
    • 1970-01-01
    相关资源
    最近更新 更多