How to draw smooth text in libgdx?

前端 未结 10 1280
暖寄归人
暖寄归人 2020-12-01 00:01

I try to draw simple text in my android game on libgdx, but it\'s look sharp. How to make text look smooth in different resolutions? My Code:



        
10条回答
  •  清歌不尽
    2020-12-01 00:56

    font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear);
    

    This gets the texture used in a BitmapFont and changes its filtering to bilinear, allowing higher resulting image quality while both up- and downscaling it at the cost of slightly slower (the difference is usually not noticeable) GPU rendering.

提交回复
热议问题