# Text added letter by letter

**URL:** <https://discourse.processing.org/t/text-added-letter-by-letter/2660>\
**Category:** Processing\
**Created:** [August 15, 2018, 12:17pm UTC](https://discourse.processing.org/t/text-added-letter-by-letter/2660 "2018-08-15T12:17:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luke](https://avatars.discourse-cdn.com/v4/letter/l/7ab992/32.png) [@Luke](https://discourse.processing.org/u/Luke)\
**Post date:** [August 15, 2018, 12:17pm UTC](https://discourse.processing.org/t/text-added-letter-by-letter/2660/1 "2018-08-15T12:17:39Z")

</div>

Hey, so here is a quick sketch as an example. I have added text to the screen all at once, just wondering if its possible to make the text appear letter by letter on the screen and how would this be achieved? Thanks.

```auto

void setup(){
  
  size(600,600);
  
}

void draw(){
  
  background(0);
  
  
   
    PFont a = createFont("Times New Roman Bold", 64);

    String b = "EXCERSIZE";
    textAlign(CENTER);
    textFont(a); 
    fill(255);
    textSize(68);
    text(b, width/2, height/2);
  
  
}

```

---

<div class="post-metadata">

**Author:** ![clankill3r](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/clankill3r/32/1098_2.png) [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Post date:** [August 15, 2018, 2:14pm UTC](https://discourse.processing.org/t/text-added-letter-by-letter/2660/2 "2018-08-15T14:14:05Z")

</div>

Here is one way

```java

void setup() {
  size(600, 600);
}

int index = 0;

void draw() {
  background(0);
  PFont a = createFont("Times New Roman Bold", 64);
  String b = "EXCERSIZE";
  textAlign(CENTER);
  textFont(a); 
  fill(255);
  textSize(68);
  text(b.substring(0, index), width/2, height/2);

  if (frameCount % 15 == 0) {
    index = min(index+1, b.length());
  }
}

```

Another way (and I leave that an exercise for you) would be to have another String in the global scope.

`String display = "";`

Then from the `b` string you keep adding chars using `b.charAt(some_index)`.
