Printing Text to screen problem
in
Programming Questions
•
1 year ago
Hi All,
I wonder if anyone has come across this and found away round it. I'm in the beginning stages of a new project. AS part of this project I need to print strings to the screen via the text() function. My problem is that I need to print the strings to screen as the code runs. However I've noticed that in Processing the loop has to complete once before printing the String to the screen via text(); is there a way around this? To demonstrate what I mean I've put a simple script below.
I wonder if anyone has come across this and found away round it. I'm in the beginning stages of a new project. AS part of this project I need to print strings to the screen via the text() function. My problem is that I need to print the strings to screen as the code runs. However I've noticed that in Processing the loop has to complete once before printing the String to the screen via text(); is there a way around this? To demonstrate what I mean I've put a simple script below.
- PFont font;
int counter = 0;
void setup()
{
size(500, 200);
smooth();
}
void draw()
{
background(255, 0, 0);
println("I am at the top of the loop");
delay(2000);
font = loadFont("Arial-Black-24.vlw");
textFont(font);
String s = "test Text";
println("I have been around the loop " + counter);
text(s, width/2, height/2);
delay(2000);
counter++;
}
1