TextData
Defined in: core/backend.ts:255
One backend-rendered text label (#105 N7b-2). Positioned in screen pixels (the caller projects
the world anchor and applies the view transform) and drawn at a constant pixel font, so labels
stay readable at any zoom — re-pushed each setTransform, like the HTML overlay it mirrors. Drawn
live by the SVG (<text>) and Canvas (fillText) backends; the WebGL backend keeps the HTML overlay
on screen (GPU/MSDF text is #69) but retains the set for export (#219), so labels survive
toSVG()/toPNG() on all three backends.
Properties
Section titled “Properties”align?
Section titled “align?”
optionalalign?:"start"|"middle"|"end"
Defined in: core/backend.ts:268
Which side of x the text runs from ("start"/"middle"/"end"). Defaults to "start".
color?
Section titled “color?”
optionalcolor?:string
Defined in: core/backend.ts:264
CSS fill colour. Defaults to black.
optionalfont?:string
Defined in: core/backend.ts:262
CSS font shorthand, e.g. "600 11px sans-serif". Defaults to "12px sans-serif".
optionalhalo?:object
Defined in: core/backend.ts:271
A halo stroked behind the fill for legibility on busy backgrounds (the export analogue of the
overlay’s text-shadow). width is the half-stroke in px.
color:
string
width:
number
opacity?
Section titled “opacity?”
optionalopacity?:number
Defined in: core/backend.ts:266
0–1 opacity (e.g. an LOD cross-fade alpha). Defaults to 1.
text:
string
Defined in: core/backend.ts:260
x:
number
Defined in: core/backend.ts:258
Screen-space anchor (CSS px). Horizontal placement relative to it follows align; the text is vertically centred on it (baseline middle).
y:
number
Defined in: core/backend.ts:259