I am following a guide on creating a replica of Flappy Bird. - http://www.kilobolt.com/day-6-adding-graphics---welcome-to-the-necropolis.html
The step I am having trouble is loading the texture from the assets directory. There are the author's instructions on how to do this.
And the code that he uses to actually load the texture
texture = new Texture(Gdx.files.internal("data/texture.png"));
My file structure looks like this(I am using Android Studio 1.0 while the author is using eclipse)
I had to manually create the data directory inside the assets folder. However when I try to run the application, I get these exceptions
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/texture.png
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: data\texture.png (Internal)
Does anyone know what the issue is? The texture.png is clearly inside the data directory of assets. I also made sure to clean the project right after copying the .png file into the data directory as the author mentioned.(so resources can be properly loaded). Is the issue just that were using two different IDES, so that different method calls have to be made?
Couldn't load file: data/texture.png
File not found: data\texture.png
\$\endgroup\$com.badlogic.gdx
as well (like backslashes being introduced somewhere but then handled the wrong way). \$\endgroup\$_texture.png
, i.e. avoiding the\t
sequence in the path? \$\endgroup\$