尝试为粒子效果加载文件时出现 NullPointerException。
particleEffect = new ParticleEffect();
particleEffect.load(Gdx.files.internal("hdpi/particles/progressbar"), Gdx.files.internal("hdpi/particles"));
这是堆栈跟踪:
Exception in thread "Timer-0" java.lang.NullPointerException
at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1372)
at com.badlogic.gdx.backends.lwjgl.LwjglGL10.glGenTextures(LwjglGL10.java:240)
at com.badlogic.gdx.graphics.Texture.createGLHandle(Texture.java:166)
at com.badlogic.gdx.graphics.Texture.create(Texture.java:158)
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:198)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.loadEmitterImages(ParticleEffect.java:193)
at com.badlogic.gdx.graphics.g2d.ParticleEffect.load(ParticleEffect.java:141)
at com.yyy.xxx.Screens.GameScreen.<init>(GameScreen.java:38)
at com.yyy.xxx.MyScreen$3.getScreenInstance(MyScreen.java:27)
at com.yyy.xxx.ScreenManager.show(ScreenManager.java:33)
at com.yyy.xxx.ScreenChangeTask.run(ScreenChangeTask.java:15)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
任何建议为什么?
更新:
我尝试在 android 上运行并且它可以工作,但我得到了这样的东西:
但是如果我关闭手机屏幕并重新打开它,我会看到这个,它应该是这样的:
我认为此更新将回复第一条评论。
1) 桌面问题未解决 2) 应用启动时出现不良粒子图像的新问题...