draw_text
Render text onto an Aseprite layer at (x, y) in one color, supporting custom fonts, scaling, and multi-line input.
Instructions
Draw text onto a layer at (x, y) in a single colour.
Args:
text: The string (supports "\n" for multiple lines).
x, y: Top-left position of the text.
color: Text colour.
scale: Integer pixel-scaling of the rendered glyphs (default 1).
font_path: Optional path to a .ttf/.otf font. If omitted, a built-in
bitmap font is used (best for tiny pixel text).
font_size: Point size when a TrueType font_path is given.
spacing: Extra pixels between lines.
threshold: 0-255 cutoff; pixels brighter than this are drawn (lower =
heavier text). Keeps glyphs crisp (no anti-aliasing artefacts).
scale is capped at 64, font_size at 512, and the rendered text at 200,000
pixels; the pixel budget is enforced while rasterizing, not afterwards.
Returns the standard draw result plus the rendered text's pixel size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| text | Yes | ||
| color | Yes | ||
| frame | No | Default: 1. | |
| layer | No | ||
| scale | No | Default: 1. | |
| spacing | No | Default: 1. | |
| filename | Yes | ||
| font_path | No | ||
| font_size | No | Default: 16. | |
| threshold | No | Default: 128. |