I want to load all my game's images on the game's startup and have a loading bar to show it's progress. I already know how to create and display the loading bar, but I can't figure out how to load the images, and then add the image's frames to it's array.

Not using SLick

  • \$\begingroup\$ How big are your images? Are you sure they won't be loaded pretty much instantaneously, thus not requiring a progress bar? \$\endgroup\$ – Thomas Jan 23 '13 at 4:25

Loading an image in Java is easy:

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;

BufferedImage image = ImageIO.read(new File(fileName));

But I have no idea what you mean by "add the image's frames to it's array".

You are not using Slick, but are you using LWJGL? If so, you need to create a Texture from this image before you can use it. Do you need help with that?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.