Nothing showing when played in javascript ?
in
Processing with Other Languages
•
4 months ago
My sketch work fine in the default mode but I'm trying to switch to JavaScript to upload to open processing and when I switch to JavaScript and press play its just blank.
Code just in case it may hold the problem.
import gifAnimation.*;
float x = 350;
float y = 25;
float w = 100;
float h = 67;
float ranNum;
int ranNumRound;
PImage img;
PImage Polaroids;
Gif loopingGif;
void setup() {
size(800, 400);
background(255);
stroke(0);
frameRate(10);
loopingGif = new Gif(this, "Blinking.gif");
Polaroids = loadImage("Polaroids.gif");
}
void draw() {
image (Polaroids, 0, -100);
image (loopingGif, x, y);
}
void mouseMoved() {
if (mouseX>x && mouseX <x+w && mouseY>y && mouseY <y+h) {
loopingGif.play();
ranNum = random(50);
ranNumRound = round(ranNum);
println(ranNumRound);
img = loadImage("images/Image"+ ranNumRound +".gif");
tint(255,255,255,100);
image(img, random(800), random(500), img.width, img.height);
}
}
1