libgdx突然停止加载图像/纹理?

时间:2014-07-11 01:26:17

标签: java libgdx

所以我启动IntelliJ并创建了一个新的libgdx项目,导入它和所有内容然后我尝试运行DesktopLauncher以查看它是否可行并且我收到此错误消息:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: badlogic.jpg
    at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
    at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTextureData.java:64)
    at com.badlogic.gdx.graphics.Texture.load(Texture.java:130)
    at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:121)
    at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:100)
    at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:92)
    at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:88)
    at com.blobb.game.PongGame.create(PongGame.java:16)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: badlogic.jpg        (Internal)
    at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136)
    at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:220)
    at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
... 9 more

Process finished with exit code 0

之前工作正常,加上我检查了“core”和“android”文件夹中的assets文件夹,他们都有badlogic.png文件。会发生什么事?

1 个答案:

答案 0 :(得分:0)

我猜你根据教程设置了一切,所以我假设一切都是正确的。然而,链接的Assets文件夹之类的东西根本就没有导入。

您可以尝试here所述的方法。说实话,我自己没有尝试过,但有些人成功使用它。

(有关您的问题的讨论,请参阅here