# IActionMarkupHandler

Interface in [Yarn.Unity](https://docs.yarnspinner.dev/api/csharp/yarn.unity)

## Summary

A [IActionMarkupHandler](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler) 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](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.pauseeventprocessor) adds a small delay between each character, creating a 'typewriter' effect as each letter appears over time.

Another example of a [IActionMarkupHandler](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler) 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)](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.oncharacterwillappear) | Called repeatedly for each visible character in the line.                            |
| [OnLineDisplayBegin(MarkupParseResult,TMP\_Text)](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.onlinedisplaybegin)                   | Called immediately before the first character in the line is presented.              |
| [OnLineDisplayComplete()](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.onlinedisplaycomplete)                                        | Called after the last call to `PresentCharacter(int, TMP_Text, CancellationToken)` . |
| [OnLineWillDismiss()](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.onlinewilldismiss)                                                | Called right before the line will dismiss itself.                                    |
| [OnPrepareForLine(MarkupParseResult,TMP\_Text)](https://docs.yarnspinner.dev/api/csharp/yarn.unity/yarn.unity.iactionmarkuphandler/yarn.unity.iactionmarkuphandler.onprepareforline)                       | Called when the line view receives the line, to prepare for showing the line.        |
