# Displaying text letter by letter

**URL:** https://discourse.processing.org/t/displaying-text-letter-by-letter/31099
**Category:** Processing.py
**Created:** [July 7, 2021, 8:25am UTC](https://discourse.processing.org/t/displaying-text-letter-by-letter/31099 "2021-07-07T08:25:31Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)
#### Post date: [July 7, 2021, 9:06am UTC](https://discourse.processing.org/t/displaying-text-letter-by-letter/31099/3 "2021-07-07T09:06:37Z")

</div>

Welcome to the Processing Community, @Polo!

Your `textAnimated` function contains this conditional block:

```auto
    if t<len(toType):
        textAnimated(toType,x,y,True)

```

Therefore, the function calls itself. Are you intentionally writing the function as a recursion?

_EDITED 2x on July 7, 2021 to add the following:_

To follow @tabreturn’s advice, you can add this prior to your function definition:

```auto
toTypeR = ""
t = 0
def setup():
    size(400, 100)
    noLoop()
def draw():
    textAnimated("This is the text!", 0, 20, True)

```

You may see the entire text appear all at once, which does not seem to be what you wanted.

Fitting the recursion into the code structure of a Processing sketch to implement an animation can be tricky. You may benefit from reading the following discussion thread for guidance:

[Is my fractal optimized? Could it animate?](https://discourse.processing.org/t/is-my-fractal-optimized-could-it-animate/28845/)

Though it focuses on Java Mode, it does include a Python Mode example.

Also see [Tower Hanoi - Why recursive draw only first and last steps?](https://discourse.processing.org/t/tower-hanoi-why-recursive-draw-only-first-and-last-steps/28923).

---

_[View the full topic](https://discourse.processing.org/t/displaying-text-letter-by-letter/31099)._
