/** * Letters. * * Draws letters to the screen. This requires loading a font, * setting the font, and then drawing the letters. */ PFont fontA; int offset=0; int i=0; int NUMCHARS=4; int letter_width=250; String msg="THIS IS THE BANNER MESSAGE"; void setup() { size(800, 600); background(255); smooth(); // Load the font. Fonts must be placed within the data // directory of your sketch. A font must first be created // using the 'Create Font...' option in the Tools menu. // Uncomment the following two lines to see the available fonts //String[] fontList = PFont.list(); //println(fontList); textAlign(LEFT); fontA = createFont("Helvetica-Bold", 255); fill(0); textFont(fontA, 600); //textMode(SCREEN); i=0; offset=int(textWidth(msg.charAt(i))); } void draw() { background(255); fill(0); text(msg.substring(i, i+NUMCHARS), 0, 500); offset-=1; if(offset<=0) { offset=int(textWidth(msg.charAt(i))); i+=1; }; if(i>msg.length()-NUMCHARS) { exit(); } }