我正在使用LibGDX 1.9.8并尝试添加用ParticleEffects制成的ParticleEditor

我尝试使用以下方法加载新效果:

torchFX.load(Gdx.files.internal("effects/torch.p"), Gdx.files.internal("effects"));


但是我收到以下错误

Exception in thread "LWJGL Application" java.lang.RuntimeException: Error parsing emitter: torch
at com.badlogic.gdx.graphics.g2d.ParticleEmitter.load(ParticleEmitter.java:1160)
at com.badlogic.gdx.graphics.g2d.ParticleEmitter.<init>(ParticleEmitter.java:103)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.newEmitter(ParticleEffect.java:227)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.loadEmitters(ParticleEffect.java:173)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.load(ParticleEffect.java:153)
at com.bbg.dc.AssetLoader.getTorchFX(AssetLoader.java:92)
at com.bbg.dc.scenes.GameScene.setupMap(GameScene.java:202)
at com.bbg.dc.scenes.GameScene.switchMap(GameScene.java:159)
at com.bbg.dc.scenes.GameScene.start(GameScene.java:139)
at com.bbg.dc.DCGame.changeScene(DCGame.java:160)
at com.bbg.dc.scenes.MainMenu.buttonPressed(MainMenu.java:33)
at com.bbg.dc.iface.Button.update(Button.java:98)
at com.bbg.dc.iface.Scene.update(Scene.java:180)
at com.bbg.dc.scenes.MainMenu.update(MainMenu.java:49)
at com.bbg.dc.DCGame.render(DCGame.java:129)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:225)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: java.lang.IllegalArgumentException: No enum constant com.badlogic.gdx.graphics.g2d.ParticleEmitter.SpawnShape.false
at java.lang.Enum.valueOf(Enum.java:238)
at com.badlogic.gdx.graphics.g2d.ParticleEmitter$SpawnShape.valueOf(ParticleEmitter.java:1637)
at com.badlogic.gdx.graphics.g2d.ParticleEmitter$SpawnShapeValue.load(ParticleEmitter.java:1622)
at com.badlogic.gdx.graphics.g2d.ParticleEmitter.load(ParticleEmitter.java:1107)
... 16 more


我已经确保在effects目录中具有particle.png。我用自己的自定义粒子效果以及ParticleEditor默认值进行了尝试。我尝试将SpawnShape更改为无济于事。我多年来一直在寻找答案,这是我无法通过搜索解决的第一个问题。我还刚刚将所有罐子更新为最新的1.9.8和最新版本的ParticleEditor。有任何想法吗?

最佳答案

我通过从与项目使用相同的gdx-tools.jar中运行ParticleEditor来解决此问题。我假设libgdx存储库中runnables文件夹中的runnable jar是相同的,但事实并非如此。两者必须使用相同的tools.jar。

10-06 05:29