java - GdxRuntimeException: File not found -
i'm following this tutorial on libgdx , i've hit bit of snag. finished 'loading assets' section. when tried run it, instead of getting rain sound , pink background, tutorial claims, errors wazoo. here's drop.java:
package com.badlogic.drop; import com.badlogic.gdx.applicationlistener; import com.badlogic.gdx.gdx; import com.badlogic.gdx.audio.music; import com.badlogic.gdx.audio.sound; import com.badlogic.gdx.graphics.gl10; import com.badlogic.gdx.graphics.texture; public class drop implements applicationlistener { texture dropimage; texture bucketimage; sound dropsound; music rainmusic; @override public void create() { // load images droplet , bucket, 64x64 pixels each dropimage = new texture(gdx.files.internal("droplet.png")); bucketimage = new texture(gdx.files.internal("bucket.png")); // load drop sound effect , rain background "music" dropsound = gdx.audio.newsound(gdx.files.internal("drop.wav")); rainmusic = gdx.audio.newmusic(gdx.files.internal("rain.mp3")); // start playback of background music rainmusic.setlooping(true); rainmusic.play(); } @override public void dispose() { } @override public void render() { gdx.gl.glclearcolor(1, 1, 1, 1); gdx.gl.glclear(gl10.gl_color_buffer_bit); } @override public void resize(int width, int height) { } @override public void pause() { } @override public void resume() { } }
and here errors. (ones think important bolded)
exception in thread "lwjgl application" com.badlogic.gdx.utils.gdxruntimeexception: com.badlogic.gdx.utils.gdxruntimeexception: couldn't load file: droplet.png @ com.badlogic.gdx.backends.lwjgl.lwjglapplication$1.run(lwjglapplication.java:113) caused by: com.badlogic.gdx.utils.gdxruntimeexception: couldn't load file: droplet.png @ com.badlogic.gdx.graphics.pixmap.(pixmap.java:140) @ com.badlogic.gdx.graphics.glutils.filetexturedata.prepare(filetexturedata.java:64) @ com.badlogic.gdx.graphics.texture.load(texture.java:175) @ com.badlogic.gdx.graphics.texture.create(texture.java:159) @ com.badlogic.gdx.graphics.texture.(texture.java:133) @ com.badlogic.gdx.graphics.texture.(texture.java:122) @ com.badlogic.drop.drop.create(drop.java:21) @ com.badlogic.gdx.backends.lwjgl.lwjglapplication.mainloop(lwjglapplication.java:127) @ com.badlogic.gdx.backends.lwjgl.lwjglapplication$1.run(lwjglapplication.java:110) caused by: com.badlogic.gdx.utils.gdxruntimeexception: file not found: droplet.png (internal) @ com.badlogic.gdx.files.filehandle.read(filehandle.java:127) @ com.badlogic.gdx.files.filehandle.length(filehandle.java:580) @ com.badlogic.gdx.files.filehandle.readbytes(filehandle.java:215) @ com.badlogic.gdx.graphics.pixmap.(pixmap.java:137) ... 8 more
the weird thing is, have of pngs , music files in assets/data folders. they're there, code isn't seeing them. idea what's causing this?
when using
gdx.files.internal
<- gets assets folder. have direct sub-directories wanting files also.
and files in assets/data use
gdx.files.internal("data/droplet.png")
be sure change other references correct location.
Comments
Post a Comment