Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [SOLVED] LibGDX can't load Textures I get?  (Read 935 times)
0 Members and 1 Guest are viewing this topic.
Offline sugarrushx6

Senior Newbie





« Posted 2013-10-24 02:13:31 »

I'm new to LibGDX. I used the setup-ui and got the projects, loaded it in eclipse, and ran the application. The data/libgdx.png got loaded. But, when I was following this tutorial:
https://github.com/libgdx/libgdx/wiki/A-simple-game
I came up to the point before creating user input, and I decided to test if LibGDX would load up the images or not.
Instead, Java generated this error:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: images/droplet.png
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:113)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn'
t load file: images/droplet.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.badlogic.drop.Drop.create(Drop.java:23)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:127)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:110)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: images\droplet.png (Internal)
   at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:127)
   at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:580)
   at com.badlogic.gdx.files.FileHandle.readBytes(FileHandle.java:215)
   at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:137)
   ... 8 more

I put the images in the assets folder in the android project and everything. Why does the libgdx.png get loaded but not the new images? I even did the exact code the tutorial was doing.
Can somebody help?

Spoiler
Offline opiop65

JGO Kernel


Medals: 123
Projects: 7
Exp: 3 years


Team Alluminum


« Reply #1 - Posted 2013-10-24 02:15:22 »

Is images your root folder for your textures? Gdx.files.internal (I believe) automatically detects your root folders, so all you need to do is specify the path in that folder. Try loading droplet.png without the images/.

Offline sugarrushx6

Senior Newbie





« Reply #2 - Posted 2013-10-24 02:26:59 »

Is images your root folder for your textures? Gdx.files.internal (I believe) automatically detects your root folders, so all you need to do is specify the path in that folder. Try loading droplet.png without the images/.
I did, that's the first thing I did. I dropped droplet.png into a new folder (images) because since libgdx.png was in a folder, I kind of thought that would solve the problem.

Spoiler
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline opiop65

JGO Kernel


Medals: 123
Projects: 7
Exp: 3 years


Team Alluminum


« Reply #3 - Posted 2013-10-24 02:53:41 »

Did you add images to the build path?

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 114
Projects: 4
Exp: 3 years



« Reply #4 - Posted 2013-10-24 04:01:32 »

libgdx.png is put in place when the setup-ui makes your projects. As for the other images, try refreshing eclipse (specifically the android project).
Offline Grunnt

JGO Wizard


Medals: 55
Projects: 9
Exp: 5 years


Complex != complicated


« Reply #5 - Posted 2013-10-24 13:31:03 »

Possibly the PNG files are formatted in a way that LibGDX cannot handle. At least, I remember having this problem once with a set of public domain PNG's I used. Opening them in paint.net and saving them as PNG again solved the problem for me.

Offline sugarrushx6

Senior Newbie





« Reply #6 - Posted 2013-10-24 22:29:29 »

Did you add images to the build path?
libgdx.png is put in place when the setup-ui makes your projects. As for the other images, try refreshing eclipse (specifically the android project).

Possibly the PNG files are formatted in a way that LibGDX cannot handle. At least, I remember having this problem once with a set of public domain PNG's I used. Opening them in paint.net and saving them as PNG again solved the problem for me.
Thanks, but none of these solutions work. The android project didn't compile, and Java generated some errors, so maybe that has something to do with it? I don't care for the HTML project.
1  
2  
3  
4  
5  
Description   Resource   Path   Location   Type
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project   drop-android      Unknown   Java Problem
The project was not built since its build path is incomplete. Cannot find the class file for com.google.gwt.core.client.EntryPoint. Fix the build path then try building this project   drop-html      Unknown   Java Problem
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files   MainActivity.java   /drop-android/src/com/badlogic/drop   line 1   Java Problem
The type com.google.gwt.core.client.EntryPoint cannot be resolved. It is indirectly referenced from required .class files   GwtLauncher.java   /drop-html/src/com/badlogic/drop/client   line 8   Java Problem

EDIT: Nvm. I didn't refresh the assets folder, because since I closed Eclipse the day before and then restarted it today, I thought it would refresh automatically.

Spoiler
Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (28 views)
2014-04-15 18:08:23

BurntPizza (25 views)
2014-04-15 03:46:01

UprightPath (40 views)
2014-04-14 17:39:50

UprightPath (22 views)
2014-04-14 17:35:47

Porlus (38 views)
2014-04-14 15:48:38

tom_mai78101 (62 views)
2014-04-10 04:04:31

BurntPizza (121 views)
2014-04-08 23:06:04

tom_mai78101 (221 views)
2014-04-05 13:34:39

trollwarrior1 (188 views)
2014-04-04 12:06:45

CJLetsGame (195 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!