API Reference · Overlays and labels
TextOptions
public sealed record class TextOptionsHow a string becomes a texture. See Texture.FromText.
Deliberately small. This is not a text layout engine and must not become one: one string, one face, one size, optional wrapping at a width. Rich text, bidi reordering beyond what the shaper does for free, inline runs and flow layout all belong to a UI framework, and a scene that needs them wants Ava3DOverlay and a real TextBlock rather than a quad.
Properties
| Member | Description |
|---|---|
| Whether the face is asked for in its bold weight. Ignored when |
| The ink, as it should appear — sRGB, 0..1, with alpha. White by default. As it should appear rather than as linear radiance, because that is what a texture is: the same bytes a PNG of this text would have carried, decoded by the shader like any other base-colour or emissive map. |
| A family name to ask the platform for, when |
| Space between lines, as a multiple of the face's own. One by default. |
| Wrap at this many texture pixels. Zero — the default — sets the whole string on one line. |
| Width of an outline drawn behind the ink, in texture pixels. Zero — the default — draws none. Worth having on anything that has to stay legible over a scene rather than over a panel: a label in a room passes over light walls and dark ones as the viewer moves, and an outline is what stops it disappearing into one of them. This is Godot's |
| The outline's colour, sRGB with alpha. Opaque black by default. |
| Font size (em height) in texture pixels — the resolution of the image, not a size in the scene. |
| The face's own bytes — a This is the only option that renders the same everywhere, and on a library that runs the same code on desktop, in a browser, on Android and on iOS that matters more than it sounds. With it null and |