|
|
@@ -4,7 +4,7 @@ SDrop drop; |
|
|
|
Bounder bounder; |
|
|
|
int imageNo = 0; |
|
|
|
int imageAmount; |
|
|
|
String[] imageList; |
|
|
|
String[] imagePaths; |
|
|
|
PImage[] images; |
|
|
|
boolean imageLoaded; |
|
|
|
String folderURI; |
|
|
@@ -36,12 +36,13 @@ void keyPressed() { |
|
|
|
if (key == ENTER) { |
|
|
|
if (bounder.state >= 3) { |
|
|
|
println("Compiling images"); |
|
|
|
bounder.compile(); |
|
|
|
bounder.compile(true); |
|
|
|
println("Compiling finished, reset bounder"); |
|
|
|
//bounder.state = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
if (key == ' ') { |
|
|
|
if(bounder.state == 3) bounder.compile(false); |
|
|
|
bounder.state = 0; |
|
|
|
println("Bounder reset"); |
|
|
|
} |
|
|
@@ -67,9 +68,10 @@ void mousePressed() { |
|
|
|
|
|
|
|
void setImage(int i) { |
|
|
|
imageLoaded = false; //seperate threat not present ladida |
|
|
|
images[i] = loadImage(imageList[imageNo]); |
|
|
|
images[i] = loadImage(imagePaths[imageNo]); |
|
|
|
imageLoaded = true; |
|
|
|
} |
|
|
|
|
|
|
|
void dropEvent(DropEvent theDropEvent) { |
|
|
|
|
|
|
|
if (theDropEvent.isFile()) { |
|
|
@@ -79,6 +81,28 @@ void dropEvent(DropEvent theDropEvent) { |
|
|
|
println(droppedFiles); |
|
|
|
folderURI = droppedFiles[0].getParent(); |
|
|
|
println(folderURI); |
|
|
|
|
|
|
|
ArrayList<String> imgs = new ArrayList<String>(); |
|
|
|
imageAmount = 0; |
|
|
|
for (int i = 0; i < droppedFiles.length; i++) { |
|
|
|
String fn = droppedFiles[i].toString().toLowerCase(); |
|
|
|
if(fn.endsWith(".jpg") || fn.endsWith(".jpeg") || fn.endsWith(".bmp") || fn.endsWith(".png") || fn.endsWith(".gif")) |
|
|
|
imgs.add(droppedFiles[i].toString()); |
|
|
|
} |
|
|
|
imageAmount = imgs.size(); |
|
|
|
imagePaths = new String[imageAmount]; |
|
|
|
imagePaths = imgs.toArray(imagePaths); |
|
|
|
imagePaths = sort(imagePaths); |
|
|
|
/* |
|
|
|
for (int i = 0; i < imageAmount; i++) { |
|
|
|
imagePaths[i] = droppedFiles[i].toString(); |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
images = new PImage[imageAmount]; |
|
|
|
setImage(imageNo); |
|
|
|
|
|
|
|
/* |
|
|
|
imageAmount = droppedFiles.length-1; // assuming all files in folder are images |
|
|
|
images = new PImage[imageAmount]; |
|
|
|
imageList = new String[imageAmount]; |
|
|
@@ -87,6 +111,10 @@ void dropEvent(DropEvent theDropEvent) { |
|
|
|
} |
|
|
|
imageList = sort(imageList); |
|
|
|
setImage(imageNo); |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*for (int i = 0; i < imageAmount; i++) { |
|
|
|
images[i] = loadImage(droppedFiles[i].toString()); |
|
|
|
println("hi"); |