【问题标题】:How to add BitmapFont to SelectBox or TextField?如何将 BitmapFont 添加到 SelectBox 或 TextField?
【发布时间】:2015-12-26 11:01:57
【问题描述】:

我点击此链接InternationalFontsTest.java ,我想使用Bitmapfont koreanFont 添加到项目选择框(Scene2d.ui)。 谢谢。

【问题讨论】:

    标签: android-studio libgdx scene2d bitmap-fonts


    【解决方案1】:

    和你设置任何样式一样:

    com.badlogic.gdx.graphics.g2d.BitmapFont: { 
      default-font: { file: default.fnt } 
      korean-font: { file:koreanfont.fnt }
      },
    
    com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: {
        default: {
            font: default-font, fontColor: white, background: default-select,
            scrollStyle: default,
            listStyle: { font: default-font, selection: default-select-selection }
        }
        korean: {
            font: korean-font, fontColor: white, background: default-select,
            scrollStyle: default,
            listStyle: { font: korean-font, selection: default-select-selection }
        }
    },
    
    com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
        default: { selection: selection, background: textfield, font: default-font, fontColor: white, cursor: cursor }
        korean: { selection: selection, background: textfield, font: korean-font, fontColor: white, cursor: cursor }
    },
    }
    

    不确定如何创建实际的位图本身,我不认为 hiero 可以做到这一点,但我可能错了。

    【讨论】:

      猜你喜欢
      • 2016-01-19
      • 1970-01-01
      • 1970-01-01
      • 2015-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-20
      • 1970-01-01
      相关资源
      最近更新 更多