所以我一直在尝试将一个粒子效果文件加载到 libgdx 并且我得到一个找不到文件的异常。
这是我的代码:
particleEffect = new ParticleEffect();
particleEffect.load(Gdx.files.internal("bin/emiter.pahh"),Gdx.files.internal("bin/untitled.png"));
这是我的文件夹的外观
:
这是错误:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: bin/untitled.png/Untitled.png
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:107)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: bin/untitled.png/Untitled.png
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:175)
at com.badlogic.gdx.graphics.Texture.create(Texture.java:159)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:133)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:126)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.loadTexture(ParticleEffect.java:195)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.loadEmitterImages(ParticleEffect.java:190)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.load(ParticleEffect.java:138)
at com.me.mygdxgame.MyGdxGame.create(MyGdxGame.java:124)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:121)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:104)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: bin\untitled.png\Untitled.png (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:127)
at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:566)
at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:215)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
... 11 more
可能是什么问题呢?