Building application that uses image files

So I’m making a small game that uses images located in the folder of the processing files. In the editor it runs without any issues. however when i build it for Windows the aplication starts but is blank. Nothing is showing up (Not the images but also not the rest of the coded visuals). I tried to build a different application without images this works perfect.

So my question is how can you include images in a build? (I’m assuming the images are the problem).
Right now I load them like this:

PImage = img;
img = loadImage(“player.png”);
image(img,x,y);

Is there a different way to do this that doesn’t conflict with building?

1 Like

By ‘build’, do you mean ‘export application’? Do you have the images in a folder called ‘data’?
If you check that data folder of images is included in the application folder then it should work.


PImage img;

void setup() {
  size(800,480);
  img = loadImage("data/image0001.png"); 
}

void draw() {
  image(img, 0, 0);
}
2 Likes

Ah that was the issue I had the images stored in the same folder as the processing files. Adding a data folder and inserting the images in there did the trick! Thanks a lot!

Edit: ah yes with “building” I did mean export application, I’m mixing up some terms from different programs I use

1 Like