# Screen Texts

The ScreenTexts plugin displays floating text on screen: damage numbers, healing numbers, experience gain notifications, level-up messages, and any other text that should appear briefly over a character or on screen.

## How Screen Texts Work

When events happen in the game (damage dealt, items picked up, experience gained), the ScreenTexts system can display a floating text message. These messages appear at a position in the world (above a character's head, at a hit location) or at a fixed screen position, then animate and fade out.

## Screen Text Entries

Create screen text configurations in the Spark Editor under the **Screen Texts** tab. Each **Screen Text Entry** defines a template for a type of floating text:

* **Text format**: How the text is composed (e.g., "+{amount} XP", "-{damage}").
* **Color**: Text color (red for damage, green for healing, yellow for experience).
* **Size**: Font size.
* **Animation**: How the text moves (float up, bounce, expand, etc.).
* **Duration**: How long the text stays visible.

## Formatter Types

Different events produce different screen texts. Each plugin can register formatter types that convert events into screen text displays:

* **ExperienceGainedFormatterType** (Progression plugin): Shows "+50 XP" when experience is gained.
* **LevelChangedFormatterType** (Progression plugin): Shows "Level Up!" when the player levels up.
* Combat formatters show damage numbers, healing numbers, miss text, critical hit text, etc.

## Using Screen Texts

Screen texts work automatically once configured. When an event fires that has a matching formatter, the text appears on screen. You configure what events produce text and how that text looks through the Spark Editor.

To add screen texts to your game:

1. Create screen text entries with the desired visual settings.
2. Ensure the relevant formatter types are active (they activate automatically with their plugins).
3. The text will appear when the corresponding events fire during gameplay.


---

# 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.sparkframework.dev/documentation/user-guide/core-systems/screen-texts.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.
