# Templates

Templates can be used to create shortcuts or presets for multiple tags. You define a new tag that gets replaced by some other tags before the text is processed by the animated text element.

<figure><img src="/files/iaOy2OUpt1q3oS8qnO2i" alt=""><figcaption><p>Templates can be found in the General section of your Text Animation Settings</p></figcaption></figure>

The replacement is done in a pre-processing step via string replacement. It's simple but powerful.

## Example

Let's start with a template like this:

| Property    | Value                      |
| ----------- | -------------------------- |
| Tag         | angry                      |
| Opening Tag | \<b>\<color="red">\<shake> |
| Closing Tag | \</shake>\</color>\</b>    |

If you use the tag like this:

`Hey, I'm a <angry>very angry</angry> character! I bet you're <wiggle>scared</wiggle>.`&#x20;

The `<angry>` and `</angry>` tags will be replaced like this:

`Hey, I'm a <b><color="red"><shake>very angry</shake></color></b> character! I bet you're <wiggle>scared</wiggle>.`&#x20;

Very intimidating. Since it's just string replacement, you can add any tags you want. Rich text tags, built-in animation tags, custom animations, etc.

{% hint style="info" %}
If you want to go crazy, you could even include template tags *inside* other style tags, but it will only work with some extra care: Each style is only replaced **once**. They get executed sequentially. That means if your first style contains a tag for your second style, the replaced tags will get replaced too, but it won't work the other way around.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stixgames.com/text-animations/templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
