Questions tagged «ttf»

6
为什么在运行Android配置时无法读取.ttf文件?
在Android设备上运行或调试游戏时,我在logcat中收到以下错误: com.badlogic.gdx.utils.GdxRuntimeException:读取文件时出错:data / fonts / myFont.ttf(内部) 这是通过以下代码行创建的: FreeTypeFontGenerator generator = new FreeTypeFontGenerator(fontFile); 其中fontFile的定义如下: FileHandle fontFile = Gdx.files.internal("data/fonts/myFont.ttf"); 当我运行桌面配置时,不会发生这种情况。 我知道对于桌面配置,您必须定义项目的工作目录,但是我在android配置中看不到这样的选项,这也没有意义,所以我认为这不是与“工作目录”相关的问题。 显然,该文件位于正确的路径中。 还要注意,在我之前的项目中,一切工作正常。我通过使用libgdx-setup创建一个新的空白prj,然后从较早的项目中复制了所有类和包,来创建了这个新项目。那么也许是与某些Gradle文件相关的问题?
9 libgdx  loading  fonts  file  ttf 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.