How do I setup the baseDir in TextureLocator.
When trying to get my program to run on a mac from a jar file I get a lot of null pointer exceptions that say:
"baseDir can not be null"
after trying to load in a texture for the scene.
Thanks for any help.
That happens when the URL you give the ResourceLocator(s) are null. Make sure the URLs you give your locators are valid and exist. This usually depends on how you get your urls; if you use new File(…).toURI().toURL() method then you need to make sure your working directory is set to where your game dir is. If using SomeClass.class.getResource(…) then the resources must be included in one of the jars in the classpath.
I had thought I had the textures in the jar file but it doesn't seem to be working on the mac. I'm probably doing something wrong.
Loading it with new File(…).toURI().toURL() works like a charm.
Many thanks.