Dem str­i­n­g­s

by Nathan Dagher
    /**@peepsketch code*/
    String[] headlines = {
      "mmmm....dem strings.....",
    };
     
    PFont f;  
    float x;
    int index=0;
     
    void setup() {
    size(400, 400);
     f= createFont("/uploads/1/Alfa Slab One.ttf", 24);
     x= width;
    }
     
    void draw() {
    background(0);
    fill (random(255),random(255),random(255));
     
    textFont(f,60);
    textAlign (CENTER);
    text (headlines[index],x, 200);
     
    x = x - 3;
    float w=textWidth (headlines[index]);
     if (x<=-w) {
     x=width;
     index=(index+1) % headlines.length;
    }
    }

    Comments

    Nobody has said anything yet.