} | } | ||||
ArrayList<Notebook> notebooks = new ArrayList<Notebook>(); | |||||
void createNotebooks() { | void createNotebooks() { | ||||
File datafolder = new File(dataPath("") + "/Notizhefte"); | File datafolder = new File(dataPath("") + "/Notizhefte"); |
result.image(leftPage, 0, 0, result.width/2, result.height); | result.image(leftPage, 0, 0, result.width/2, result.height); | ||||
result.image(rightPage, result.width/2, 0, result.width/2, result.height); | result.image(rightPage, result.width/2, 0, result.width/2, result.height); | ||||
result.endDraw(); | result.endDraw(); | ||||
PImage res = createImage(width, height, ARGB); | |||||
res = result.get(); | |||||
return res; | |||||
return result.get(); | |||||
} | } | ||||
boolean transition; | |||||
void nextSlide() { | void nextSlide() { | ||||
transition = true; | transition = true; | ||||
if (currentSlideNo > notebooks.get(currentNotebookNo).imagepaths.length-1) { | if (currentSlideNo > notebooks.get(currentNotebookNo).imagepaths.length-1) { | ||||
currentSlideNo = 0; | currentSlideNo = 0; | ||||
currentNotebookNo++; | currentNotebookNo++; | ||||
if(currentNotebookNo == notebooks.size()) currentNotebookNo = 0; | |||||
} | } | ||||
} else if (mode == RANDOM) { | } else if (mode == RANDOM) { | ||||
currentNotebookNo = (int)random(notebooks.size()); | currentNotebookNo = (int)random(notebooks.size()); | ||||
currentSlideNo = (int)random(notebooks.get(currentNotebookNo).imagepaths.length); | |||||
currentSlideNo = (int)random(notebooks.get(currentNotebookNo).imagepaths.length-1); | |||||
if (currentSlideNo %2 != 0) { | if (currentSlideNo %2 != 0) { | ||||
currentSlideNo -= 1; | currentSlideNo -= 1; | ||||
} | } |
168 | |||||
0 | 0 | ||||
8 |
//////// Config | //////// Config | ||||
int mode = NORMAL; //NORMAL or RANDOM order | |||||
float timerTime = 5000; //in milliseconds how long slide is shown | |||||
float transitionTime = 3000; //how long it takes to fade the next slide in. must not be greater than "timerTime" | |||||
int mode = RANDOM; //NORMAL or RANDOM order | |||||
float timerTime = 250; //in milliseconds how long slide is shown | |||||
float transitionTime = 100; //how long it takes to fade the next slide in. must not be greater than "timerTime" | |||||
boolean displayText = true; //if the "date" should be written on screen | boolean displayText = true; //if the "date" should be written on screen | ||||
boolean displayTimeline = true; //if the timeline should be drawn on screen | boolean displayTimeline = true; //if the timeline should be drawn on screen | ||||
// | // | ||||
Timer timer; | Timer timer; | ||||
ArrayList<Notebook> notebooks = new ArrayList<Notebook>(); | |||||
PImage currentSlide, nextSlide; | PImage currentSlide, nextSlide; | ||||
int currentNotebookNo, currentSlideNo; | int currentNotebookNo, currentSlideNo; | ||||
int startTransitionTime; | int startTransitionTime; | ||||
boolean transition; | |||||
float transitionProgress; | float transitionProgress; | ||||
final static int NORMAL = 0; | final static int NORMAL = 0; | ||||
final static int RANDOM = 1; | final static int RANDOM = 1; |