fjenett / javascript-mode-processing

Former ProcessingJS mode (Processing 1.5) that became JavaScript mode (Processing 2.0 beta) that has now been moved out of the Processing IDE.
57 stars 13 forks source link

@pjs preload doesn't export images #36

Closed enthusiasmus closed 9 years ago

enthusiasmus commented 9 years ago

Using the JavaScript Mode with the Processing IDE 2.2.1

/* @pjs preload="stars.jpeg"; */

void setup(){
  size(450,450);
  background(244);

  PImage img = loadImage("stars.jpeg");
  image(img, 0, 0); 
}

After starting the server, the browser opens a new tab, but I only see a blank screen: Because the images aren't copied to the web-export directory. When I manually copy the images to the web-export directory and reloading the browser the image is shown. Seems to be a bug?

fjenett commented 9 years ago

Where do the images sit in your sketch folder hierarchy? Inside "data"?

enthusiasmus commented 9 years ago

It was sitting in the directory of the pde file. So i put it in the "data" directory and now it works! As javascript developer I couldn't find that advice on the processingjs.org website... so thanks!

fjenett commented 9 years ago

Yeh, it's Processing specific. If i was to support files in the sketch folder that would cause all kinds of problems because i would need to know which to copy/ignore.

On November 17, 2015 8:45:21 AM GMT+01:00, MMTLukas notifications@github.com wrote:

It was sitting in the directory of the pde file. So i put it in the "data" directory and now it works! As javascript developer I couldn't find that advice on the processingjs.org website... so thanks!


Reply to this email directly or view it on GitHub: https://github.com/fjenett/javascript-mode-processing/issues/36#issuecomment-157301225

Sent from my Android device with K-9 Mail. Please excuse my brevity.