Hi all, apologies if this has been asked before - I've searched the forum and didn't find anything...
I'm a complete novice to Processing, and I'm three-quarters through a simple project - designing a presentation lesson using Processing.
I've spent days working out nice animations, etc, and now I've hit a complete dead end...
When trying to load the text file with the numerous lines of the presentation, I get the "cannot convert from String to String[]".
I have limited coding skills, but I'm aware that there should be some method to call - Googling the error, I found ways around this in other languages, but cannot get these to work.
I simply want to display 8 lines of text within the display, and, once a mouse click occurs, the next 8 lines replace the current lines.
I've stripped out the rest of the code, and the problematic code is below:
int lineCount = 0;
int lineSize = 35;
public String lines[] = dataPath("list.txt");
void setup() {
size(800,560);
PImage img;
img = loadImage("green-blank-blackboard.jpg");
background(img);
PFont font;
font = loadFont("KristenITC-Regular-32.vlw");
textFont(font, 32);
}
void draw() {
noStroke();
noFill();
}
void mouseClicked(){
//String lines[] = loadStrings("list.txt");
for (int i=lineCount; i < lineCount; i++) {
text(lines[i],40,lineSize*i*2);
}
lineCount = lineCount + 8;
}
Any help would be greatly appreciated, as I've wasted loads of time making the rest look pretty, and I'm burned out at this stage!
I'm a complete novice to Processing, and I'm three-quarters through a simple project - designing a presentation lesson using Processing.
I've spent days working out nice animations, etc, and now I've hit a complete dead end...
When trying to load the text file with the numerous lines of the presentation, I get the "cannot convert from String to String[]".
I have limited coding skills, but I'm aware that there should be some method to call - Googling the error, I found ways around this in other languages, but cannot get these to work.
I simply want to display 8 lines of text within the display, and, once a mouse click occurs, the next 8 lines replace the current lines.
I've stripped out the rest of the code, and the problematic code is below:
int lineCount = 0;
int lineSize = 35;
public String lines[] = dataPath("list.txt");
void setup() {
size(800,560);
PImage img;
img = loadImage("green-blank-blackboard.jpg");
background(img);
PFont font;
font = loadFont("KristenITC-Regular-32.vlw");
textFont(font, 32);
}
void draw() {
noStroke();
noFill();
}
void mouseClicked(){
//String lines[] = loadStrings("list.txt");
for (int i=lineCount; i < lineCount; i++) {
text(lines[i],40,lineSize*i*2);
}
lineCount = lineCount + 8;
}
Any help would be greatly appreciated, as I've wasted loads of time making the rest look pretty, and I'm burned out at this stage!
1
