Class: TextPrimitive
Experimental
Batched label set. Create with createTextPrimitive; add object to a scene.
ready resolves once every typesetting triggered so far has finished (a fresh promise after each update that re-typesets), including loading the text engine when the first labels arrive before it has loaded, and the default font faces the labels need; visual tests and chart.ready await it before capturing.
Implements
Constructors
Constructor
new TextPrimitive(context, options?): TextPrimitive;Experimental
Parameters
| Parameter | Type |
|---|---|
context | PrimitiveContext |
options | TextPrimitiveOptions |
Returns
TextPrimitive
Properties
Accessors
decorationCount
Get Signature
get decorationCount(): number;Experimental
Number of decoration lines drawn (font.lineposition), for debugging and tests.
Returns
number
pooledCount
Get Signature
get pooledCount(): number;Experimental
Number of pooled (idle) troika members, for debugging and tests.
Returns
number
ready
Get Signature
get ready(): Promise<void>;Experimental
Resolves when all typesetting requested so far has completed and been packed, including loading the text engine first if labels arrived before it had loaded, and the default font faces the labels are drawn with.
Returns
Promise<void>
Methods
dispose()
dispose(): void;Experimental
Release GPU resources. The primitive must not be used afterwards.
Returns
void
Implementation of
setTransform()
setTransform(transform): void;Experimental
Set the data → world transform (cheap: uniforms only, no buffer uploads).
Parameters
| Parameter | Type |
|---|---|
transform | DataTransform |
Returns
void
Implementation of
setViewport()
setViewport(size): void;Experimental
Update viewport-dependent uniforms (resolution, pixel ratio).
Parameters
| Parameter | Type |
|---|---|
size | ViewportSize |
Returns
void
Implementation of
update()
update(patch): void;Experimental
Replace or patch the primitive's data. Omitted fields keep their previous values.
Parameters
| Parameter | Type |
|---|---|
patch | Partial<TextData> |
Returns
void
Implementation of
whenReady()
whenReady(): Promise<void>;Experimental
Same as ready, as a method.
Returns
Promise<void>