# Text layer

> Renders a text template as a transparent video stream; {1} to {8} in the template show control lanes. Scoreboards and lower thirds.

Source: https://docs.tune.toys/nodes/video.text/

Text layer renders a text template as a transparent video stream, with control lanes inserted into the text.

## What it does

The template is `data.template`. In it `{1}` to `{8}` show lane 1 to 8 of the `fields` control input, with the number of decimals set by Decimals. The output is transparent except for the text, so it composites over any picture. Size, position, alignment, colour, opacity and shadow style the text; Width and Height set the surface size.

## When to use it

Use it for scoreboards, labels and lower thirds. Feed `fields` from [Counter](https://docs.tune.toys/nodes/ctl.counter/) for a score or from [Select lanes](https://docs.tune.toys/nodes/ctl.select/) for any single value.

## Ports

<!-- ports:start -->

| Port     | Direction | Signal  | Lanes                   |
| -------- | --------- | ------- | ----------------------- |
| `fields` | Input     | Control | Inferred from the cable |
| `video`  | Output    | Video   | 1                       |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter  | Label    | Range      | Default | Unit | Scale  | Notes                                                             |
| ---------- | -------- | ---------- | ------- | ---- | ------ | ----------------------------------------------------------------- |
| `size`     | Size     | 8 to 400   | 64      | px   | log    | Font size in pixels of the rendered frame.                        |
| `x`        | X        | 0 to 1     | 0.5     |      | linear | Horizontal anchor position across the frame.                      |
| `y`        | Y        | 0 to 1     | 0.5     |      | linear | Vertical anchor position down the frame.                          |
| `align`    | Align    | 0 to 2     | 1       |      | linear | Text alignment at the anchor. Choices: 0 Left, 1 Centre, 2 Right. |
| `red`      | Red      | 0 to 1     | 1       |      | linear | Red component of the text colour.                                 |
| `green`    | Green    | 0 to 1     | 1       |      | linear | Green component of the text colour.                               |
| `blue`     | Blue     | 0 to 1     | 1       |      | linear | Blue component of the text colour.                                |
| `opacity`  | Opacity  | 0 to 1     | 1       |      | linear | Opacity of the text.                                              |
| `shadow`   | Shadow   | 0 to 1     | 0.5     |      | linear | Strength of the drop shadow behind the text.                      |
| `decimals` | Decimals | 0 to 4     | 0       |      | linear | Decimal places shown for lane values.                             |
| `width`    | Width    | 64 to 3840 | 1280    | px   | linear | Width of the rendered frame.                                      |
| `height`   | Height   | 64 to 2160 | 720     | px   | linear | Height of the rendered frame.                                     |

<!-- parameters:end -->

<!-- data:start -->

- `template`: text.
- `font`: text.

<!-- data:end -->

### Size (`size`)

Font size in pixels, from 8 to 400. It is logarithmic.

### X (`x`)

Horizontal position of the text, 0 left to 1 right.

### Y (`y`)

Vertical position of the text, 0 top to 1 bottom.

### Align (`align`)

Text alignment: 0 left, 1 centre, 2 right.

### Red (`red`)

Red amount of the text colour.

### Green (`green`)

Green amount of the text colour.

### Blue (`blue`)

Blue amount of the text colour.

### Opacity (`opacity`)

Overall opacity of the text.

### Shadow (`shadow`)

Strength of the drop shadow behind the text.

### Decimals (`decimals`)

How many decimal places a control lane shows, from 0 to 4.

### Width (`width`)

Width of the text surface in pixels.

### Height (`height`)

Height of the text surface in pixels.

## Tips

- Leave `fields` unconnected for fixed text.
- A lane shows its 0 to 1 value; scale it first with [Scale](https://docs.tune.toys/nodes/ctl.scale/) for a score.
- Video needs the browser's WebGPU video engine. The Player and exports do not run video yet and report it unavailable. To see a video output, bind a live Screen in the Frame to it.

## See also

[Counter](https://docs.tune.toys/nodes/ctl.counter/), [Composite](https://docs.tune.toys/nodes/video.composite/), [Select lanes](https://docs.tune.toys/nodes/ctl.select/), [Video](https://docs.tune.toys/concepts/video/), [Control lanes](https://docs.tune.toys/concepts/control-lanes/).
