I am trying to load Texture into libGDX and I am getting an exception not found in the file.
Here is the code that is trying to download the .png file.
Here is the error message:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: tiles.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.mr.zen.level.WorldRenderer.loadTextures(WorldRenderer.java:62) at com.mr.zen.level.WorldRenderer.<init>(WorldRenderer.java:58) at com.mr.zen.screens.GameScreen.show(GameScreen.java:29) at com.badlogic.gdx.Game.setScreen(Game.java:62) at com.mr.zen.Zen.create(Zen.java:12) 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: tiles.png (Internal) at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:132) at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:586) at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:220) at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137) ... 12 more
The problem exists in the loadTextures () method. Cannot find file.
tiles = new Texture(Gdx.files.internal("tiles.png"));
I definitely put the .png files in the resource folder of the Android project files. I have no idea what it is; I got this to work on other projects, but this time something went wrong. Thanks for any help.
java libgdx
Kaptnkrunch
source share