我們正試圖在資源管理器中加載一個真正的字體字體在libgdx項目中。我們遵循嚴格的wiki entry。然而,我們得到的異常LIBGDX資產管理器加載真實字體字體
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: basicfont.ttf
用下面的代碼
// First, let's define the params and then load our smaller font
FreetypeFontLoader.FreeTypeFontLoaderParameter parameter = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
parameter.fontFileName = "basicfont.ttf";
parameter.fontParameters.size = 10;
game.manager.load("font.ttf", BitmapFont.class, parameter);
game.manager.finishLoading();
我們已經加載的字體沒有資產管理公司。 此外,我們還讀了this link並按照說明解決問題。
謝謝!奇蹟般有效 :) – user107641