Skip to content

1681-engine / index / FloatingTextOptions

Interface: FloatingTextOptions ​

Defined in: src/fx/FloatingText.ts:11

Properties ​

depth? ​

ts
optional depth?: number;

Defined in: src/fx/FloatingText.ts:25

Depth given to every label taken (default: left as made).


fontFamily ​

ts
fontFamily: string;

Defined in: src/fx/FloatingText.ts:13

A font already loaded (document.fonts.load), or the glyphs bake in the fallback.


glyphs? ​

ts
optional glyphs?: string;

Defined in: src/fx/FloatingText.ts:23

Letters beyond ASCII the labels print (see installLabelFont), baked with each style's font.


keepPerStyle? ​

ts
optional keepPerStyle?: number;

Defined in: src/fx/FloatingText.ts:21

Spent labels of one style kept for reuse; the rest are destroyed (default 24).


parent? ​

ts
optional parent?: Container<ContainerChild>;

Defined in: src/fx/FloatingText.ts:30

Where new labels are added (default the stage's world layer). Give a scene's root and the labels live and die with the scene: on the world layer they outlive it, and a label still floating when the scene changes stays.


resolution? ​

ts
optional resolution?: number;

Defined in: src/fx/FloatingText.ts:19

Rasterising resolution (default 4, crisp under a zoomed camera).


stroke? ​

ts
optional stroke?: string;

Defined in: src/fx/FloatingText.ts:15

Outline colour (default near-black).


strokeWidth? ​

ts
optional strokeWidth?: (size) => number;

Defined in: src/fx/FloatingText.ts:17

Outline width for a size (default a fifth of it, at least 2).

Parameters ​

ParameterType
sizenumber

Returns ​

number

Released under the MIT License.