// Experiments with text // Use this command to get a list of // fonts installed on the system //println(PFont.list()); // Global variables PFont f, g; float angle1, angle2, angle3; void setup() { size(400, 400, P3D); // Create a font for 32-point smoothed // Verdana Italic f = createFont("Verdana-Italic", 32, true); g = createFont("Zapfino", 48, true); angle1 = 0; angle2 = 0; angle3 = 0; } void draw() { background(10); textAlign(CENTER); pushMatrix(); // Save current state // Shift origin to center of window translate(width/2, height/2); fill(200, 100, 200); rotate(radians(angle1)); textFont(f); text("Hello, world!", 0, 0); angle1 = angle1 + 0.5; popMatrix(); // Revert to previous state pushMatrix(); // Save current state fill(100, 200, mouseX); // 175); translate(100, 100); rotate(radians(angle2)); textFont(g); text("Foo!", 0, 0); angle2 = angle2 - 0.5; popMatrix(); // Return to previous state pushMatrix(); translate(50, 350); rectMode(CENTER); fill(230, mouseY /*100*/, 100); rotateY(angle3); rotateX(angle3); box(50, 50, 50); angle3 = angle3 + 0.01; popMatrix(); }