Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PFont f = createFont("Georgia", 100);
- String s = "To be or not to be.";
- int frames=240;
- float theta;
- void setup() {
- size(500, 300);
- textFont(f);
- }
- void draw() {
- background(255);
- fill(20);
- float x = 20;
- int num = s.length();
- for (int i=0; i<num; i++) {
- float offSet = TWO_PI/num*i;
- char c = s.charAt(i);
- float ts = map(sin(theta+offSet), -1, 1, 25, 90);
- textSize(ts);
- //textAlign(CENTER);
- text(c, x, 200);
- x += textWidth(c);
- }
- theta += TWO_PI/frames;
- //if (frameCount<=frames) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement