We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I have a Processing Program that draws a file on canvas. The file is selected dynamically by the user.
void setup() {
size(300, 300);
background(0);
stroke(255);
noSmooth();
textSize(15);
text("Select a file...", 20, 30);
selectInput("Select a file:", "fileSelected");
frameRate(50);
}
void fileSelected(File selection) {
if (selection == null) {
exit();
} else {
background(0);
// v other things...
}
}
When I upgraded to Processing 3 I realised that the background(0) doesn't executes. I believe that none of the draw specific functions don't longer work outside draw() and setup(). Is there any way to accomplish this again? Also, I noticed that I can't pass variables to size() anymore, and I must strong type them.
Thanks!
Answers
boolean
in order to flag a File was successfully selected.boolean
.true
, do the stuff that you were attempting to do from selectInput().boolean
back tofalse
afterwards.