The problem am facing is that when i run the example Background image the example runs properly on Chrome and firefox
but when i copy that program and save it in Processing sketch folder with an other name say "example1" it doesnt work in Javascript mode but works in Javamode of processing ide
version 2.08b Note:i have placed the image in the folder named "data" and i see that the image gets imported once i run the program into the web-export folder but the problem is that background image is not set
please tell me if i am missing any step
the below is the code which i tried
/** * Background Image. * * This example presents the fastest way to load a background image * into Processing. To load an image as the background, it must be * the same width and height as the program. */
// The next line is needed if running in JavaScript Mode with Processing.js /* @pjs preload="helloworld.jpg"; */
PImage bg; int y;
void setup() { size(621, 401);// the changes i made to match the image size
The problem am facing is that when i run the example Background image the example runs properly on Chrome and firefox
but when i copy that program and save it in Processing sketch folder with an other name and making suitable changes to the size() function so that the image iam using is same as the window size and making sure that the image iam using is in the same folder as sketch and after doing all this when i run this example the image is not set as the back ground in chrome as well as firefox ...feeling strange as in java mode it works.
ive used processing quite a bit but first time trying out Javascript mode on processing 2.07b
ne help will be appreciated
this is the changes to the code i made
Note:i have placed the image in the same folder where the sketch resides
please tell me if i am missing any step
/** * Background Image. * * This example presents the fastest way to load a background image * into Processing. To load an image as the background, it must be * the same width and height as the program. */
// The next line is needed if running in JavaScript Mode with Processing.js /* @pjs preload="helloworld.jpg"; */
PImage bg; int y;
void setup() { size(621, 401);// the changes i made to match the image size