# IActionMarkupHandler

Interface in [Yarn.Unity](/3.1/api/csharp/yarn.unity.md)

## Summary

A [IActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.md) is an object that reacts to the delivery of a line of dialogue, and can optionally control the timing of that delivery.

```csharp
public interface IActionMarkupHandler
```

## Remarks

There are a number of cases where a line's delivery needs to have its timing controlled. For example, [PauseEventProcessor](/3.1/api/csharp/yarn.unity/yarn.unity.pauseeventprocessor.md) adds a small delay between each character, creating a 'typewriter' effect as each letter appears over time.

Another example of a [IActionMarkupHandler](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.md) is an in-line event or animation, such as causing a character to play an animation (and waiting for that animation to complete before displaying the rest of the line).

## Methods

| Name                                                                                                                                                                                  | Description                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [OnCharacterWillAppear(int,MarkupParseResult,CancellationToken)](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.oncharacterwillappear.md) | Called repeatedly for each visible character in the line.                            |
| [OnLineDisplayBegin(MarkupParseResult,TMP\_Text)](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.onlinedisplaybegin.md)                   | Called immediately before the first character in the line is presented.              |
| [OnLineDisplayComplete()](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.onlinedisplaycomplete.md)                                        | Called after the last call to `PresentCharacter(int, TMP_Text, CancellationToken)` . |
| [OnLineWillDismiss()](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.onlinewilldismiss.md)                                                | Called right before the line will dismiss itself.                                    |
| [OnPrepareForLine(MarkupParseResult,TMP\_Text)](/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.onprepareforline.md)                       | Called when the line view receives the line, to prepare for showing the line.        |


---

# 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.yarnspinner.dev/3.1/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler.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.
