0

so i have made a 2D game using slick however the only resource loader that i have ever made is for plain java and it went like this :

import java.awt.Image;
import java.awt.Toolkit;

 public class ResourceLoader {

static ResourceLoader rl = new ResourceLoader();

public static Image getImage(String fileName){
    return  Toolkit.getDefaultToolkit().getImage(rl.getClass().getResource("images/" + fileName));
}

 }

Slick, of course, has a different image type (org.newdawn.slick.Image) for which this Resource Loader Class will not work and so i do not know how, for when i export my project , to load resources. I have searched online but haven't found many detailed results and so i ask is there any way to load resources so when i export the project as a run able jar file it will still load them.

thanks for any helpful answers in advance - josh

Josh Jackson
  • 119
  • 1
  • 2
  • 9

1 Answers1

1

Not sure if you've seen it but here's one way of doing this. Explains deferred loading:

http://slick.cokeandcode.com/wiki/doku.php?id=resource_manager_tutorial

You might want to check out the other tutorials by Spiegel if you're starting out with Slick2D. I've found them very useful

Plasty Grove
  • 2,807
  • 5
  • 31
  • 42