The 2D layer · function
runsFor
Fill out with disjoint, ordered, gap-free runs covering [0, text.length).
Explained in Sprites and tilemaps.
function runsFor(text: string, runs: readonly TextRun[], out: TextRun[]): numberimport { runsFor } from '@driftengine/ui2d';Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | |
runs | readonly TextRun[] | |
out | TextRun[] |
In depth
Returns how many were written. With no input runs the answer is one run covering everything, which is what a plain string is.