> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/code/standard-visuals/textruntime/maxletterstoshow.md). Agents can also search and read this documentation through its [MCP server](https://docs.flatredball.com/gum/~gitbook/mcp).

# MaxLettersToShow

## Introduction

`MaxLettersToShow` controls the number of letters that are displayed by a `TextRuntime`. This value can be used to print text out letter-by-letter. This property does not change alignment or size of text. In other words, a TextRuntime with its `WidthUnits` or `HeightUnits` of `RelativeToChildren` reports the same absolute width regardless of its `MaxLettersToShow` value.

## Code Example - Printing Letters One at a Time

The following code can be used to print letters out one at a time. `deltaSeconds` is your framework's frame time in seconds.

```csharp
// Class scope
TextRuntime textRuntime;
bool isPrinting = false;
float numberOfCharacters;

// Initialize
textRuntime = new TextRuntime();
textRuntime.AddToRoot();
textRuntime.Text = "This is longer text which is used to " +
    "create word wrapping. Notice that when this prints out, " +
    "it prints one letter at a time and wraps according to the " +
    "TextRuntime's bounds";

textRuntime.Anchor(Anchor.Center);
textRuntime.Width = 200;
textRuntime.WidthUnits = Gum.DataTypes.DimensionUnitType.Absolute;
textRuntime.Height = 0;
textRuntime.HeightUnits = Gum.DataTypes.DimensionUnitType.RelativeToChildren;
textRuntime.MaxLettersToShow = 0;

// Update
GumUI.Update(gameTime);

if(GumUI.Keyboard.KeyPushed(Gum.Forms.Input.Keys.Space))
{
    isPrinting = true;
    numberOfCharacters = 0;
}

if(isPrinting)
{
    const int charactersPerSecond = 20;
    numberOfCharacters += 
        (float)deltaSeconds * charactersPerSecond;

    textRuntime.MaxLettersToShow = (int)numberOfCharacters;
}

```

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-965b848d341628270bc7b44cede0d76a102c96c9%2F08_13%2028%2026.gif?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/gum/code/standard-visuals/textruntime/maxletterstoshow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
