I downloaded all my images in the past, and I use OpenGL ES 2.0 so that the images do not need the power of two (I have several downloaded successfully, but it is not).
This code is as follows:
Line 96: splashSheet = new Texture(Gdx.files.internal("test.png"));
This is my error message:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: test.png at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:111) Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: test.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:122) at com.panini.game.GameScreen.show(GameScreen.java:96) at com.badlogic.gdx.Game.setScreen(Game.java:59) at com.panini.game.Splash.render(Splash.java:29) at com.badlogic.gdx.Game.render(Game.java:46) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:190) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:108) Caused by: java.io.IOException: couldn't load pixmap at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.<init>(Gdx2DPixmap.java:57) at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:138) ... 11 more
Here is what makes this problem interesting. I can download this file , but I can not download this . The first is basically just a cropped screen shot that I want to use. The second image I provided (which does not work) is the original. It is called splashSprites.png, but I tried renaming it to test.png and referring to it correctly, but it still does not work, so I know that this is definitely not a naming problem. If I put both files in a resource directory or bin with the names test1.png and test2.png respectively, then the code will work if I ask to download test1.png, but not if I ask to download test2.png, so itβs not, m also puts files in the wrong place. These two seemed to be the most likely candidates, but I excluded them.
I tried other things, such as re-exporting the first image, etc., but it never worked (which took a screenshot, so here I am). I suppose this may have something to do with alpha in one of the images (because it is really the only thing that is different from the two - one has alpha and the other does not), but this is unlikely since I was able to load some other textures that had alpha. I'm really at a standstill.
Thanks in advance.
Panini raman
source share