Advertisement
xeromino

tobe

Oct 29th, 2014
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. PFont f = createFont("Georgia", 100);
  2. String s = "To be or not to be.";
  3. int frames=240;
  4. float theta;
  5.  
  6. void setup() {
  7.   size(500, 300);
  8.   textFont(f);
  9. }
  10.  
  11. void draw() {
  12.   background(255);
  13.   fill(20);
  14.   float x = 20;
  15.   int num = s.length();
  16.   for (int i=0; i<num; i++) {
  17.     float offSet = TWO_PI/num*i;
  18.     char c = s.charAt(i);
  19.     float ts = map(sin(theta+offSet), -1, 1, 25, 90);
  20.     textSize(ts);
  21.     //textAlign(CENTER);
  22.     text(c, x, 200);
  23.     x += textWidth(c);
  24.   }
  25.   theta += TWO_PI/frames;
  26.   //if (frameCount<=frames) saveFrame("image-###.gif");
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement