Well how should I start…
I am working on a game called DigiLife, shown in this thread: http://www.java-gaming.org/topics/re-innovated-wip-digilife/27470/view.html
However, I want to test out the distribution by packing it into a jar. I’ve used JarSplice and successfully managed to pack the fat jar, however, when I run it, problems arise with the use of the ‘res’ folder.
Now I understand that, before I used slick, when I set my ‘res’ folder as ‘class folder’, I ca n load images by using
‘BufferedImage img = ImageIO.read(ImageLoader.class.getResourceAsStream());’
where ImageLoader is the class I use to load Images. However, Slick Images does seem to get a bit weird, since it DOES accept an InputStream in its constructor but also require a String of ‘ref’ which is the NAME of the image (Why do you even need a name?) and a boolean of flipped in the y axis.
I decided to bypass all that since I tried it and it doesn’t work, so my current distribution method is to remove res as class folder and manually inject the res folder into the exported fat jar. This worked fine under Windows but the strange thing is when I run it on a mac.
When I double click the fat jar (with the res inserted), it creates a frame, flickers for 1 second and the program terminates. I then tried running it in the terminal, however, it works fine…
Any suggestions?
P.S. In my image loader class, I use:
Image image = new Image(“res/whatever_image.png”);
since I manually inject the res folder and it is not a class folder.