Libgdx + Eclipse.

Sooo I started working with Libgdx yesterday. Downloaded everything and stuff. I almost finished porting my game from LWJGL to Libgdx. Wanted to see performance difference.

Soo what I found out, was that after I edit my sprite sheet and save it, changes don’t appear in my game when I run it. I need to refresh Libgdx Android project in Eclipse for changes to take effect. Is there a way to fix this?

This isn’t a libGDX problem. You need to refresh any Eclipse project if you change a file other than a class. AFAIK, There’s no option in Eclipse to have it automatically refresh. :-/

What do you mean this is not libgdx problem. It is. When I was working with 1 project and LWJGL, there as no such problem.

When I run my program, the image that I changed using paint.net doesn’t change. I need to refresh eclipse so that I can see changes IN MY PROGRAM. I know that eclipse doesn’t refresh when you add/remove file through windows. But this is different problem entirely.

It might have worked previously, yet it is still Eclipse that is responsible for refreshing and keeping the workplace up-to-date.
Try this “Preferences -> General -> Workspace” and “Refresh using native hooks or poll” and “Refresh on Access”

Yes, you were working with 1 project. The assets in libgdx are in the Android project, and you normally will change the main project. That means, Android project will not be refreshed automatically since eclipse will not invoke a build on it for no reason.

On a side note, you should really try to be more polite on this forum, specially to people trying to help. This is not the first nor second time I see you talking to people like they have the obligation to help you and give you the answer you deem correct. More specially in the case he is right and you are wrong - it is not a libgdx problem.

So does that mean that when I run my program in Eclipse, it has already stored all the stuff from the hard drive into memory? Before my program even starts? Does that mean that my program is not actually reading from the hard drive, but memory instead?

Eclipse maintains its own file cache, which can become inconsistent in projects spanning multiple eclipse projects. You could come around eclipse’s caching by loading resources with a different FileHandle type (Local, I think, or external - don’t remember which).

Ref: https://github.com/libgdx/libgdx/wiki/File-handling

I found a way to fix that thingy where you have to refresh resources manually.

goto:

Window -> Preferences -> General -> Workspace -> Refresh On Access (tick on)

EDIT—
(Ow shit it actually doesn’t work…)
EDIT----------
(Ow shit it actually does work… :D)
EIDT---------------
(Ow shit it kinda works… It seems that it refreshes after 5 seconds the changes were made or something like that)

Have you conisdered using IntelliJ IDEA (free community edition) + libgdx? That is the combination I have used for the past year and I can’t recommend it enough.

I always like to try new programs :stuck_out_tongue: Thanks I will try it.


It costs 500$??? For what??..

Uhmmmm, it also seems to be lot slower than eclipse… After typing 1 word it always hangs up for a moment. This should be easily fixable by disabling some plugins I guess, but I still don’t like it :smiley:

Getting used to new controls would be too much of a challenge…

I think I will stick with Eclipse for now… Might try Netbeans just for fun :smiley:

With my android projects in eclipse, when I replace some resource I need to replace same file two times, or clean the project, or try to run the application to refresh the graphical layout.
I will try to tick “Refresh On Access” option and see if it refresh automatically, thanks for this tips.

EDIT: Do not work for me.

Ummm tick “native something” options near the one I said. It updates after 5 seconds.

“native hooks or polling” does not work for me too.

But, I tick “refresh using native hooks or polling” and “refresh on access” and it works now!
I do not understand why. Just one of the options ticked does nothing.

Well, thanks for this tips. Now I do not need to update same resources two times.

Never experienced that slow down. Most people report it being faster than Eclipse.

As for the price, the community edition is enough for most people.