@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / UITextComponent
Class: UITextComponent ​
Defined in: components/UIText.ts:35
A block of text drawn onto a transparent canvas quad.
Pure text — put a UIPanelComponent entity behind it for a card look. fontSize is in METRES (how tall the glyphs stand in the world), so text reads the same regardless of texture density. Wrapping is automatic inside width; overflow past height is line-clamped with an ellipsis.
Extends ​
Constructors ​
Constructor ​
ts
new UITextComponent(options?): UITextComponent;Defined in: components/UIText.ts:67
Parameters ​
| Parameter | Type |
|---|---|
options? | UITextOptions |
Returns ​
UITextComponent
Overrides ​
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
text | string | - | components/UIText.ts:36 |
width | number | Layout box width in metres — wrap happens against this. | components/UIText.ts:38 |
height | number | Layout box height in metres — overflow clamps to it. | components/UIText.ts:40 |
fontSize | number | Glyph height in metres. | components/UIText.ts:42 |
fontWeight | number | CSS font weight (400 normal, 600 semibold…). | components/UIText.ts:44 |
color | string | - | components/UIText.ts:45 |
align | UiTextAlign | - | components/UIText.ts:46 |
valign | UiTextVAlign | - | components/UIText.ts:47 |
lineHeight | number | Unitless multiplier over fontSize. | components/UIText.ts:49 |
padding | number | Inner padding in metres. | components/UIText.ts:51 |
pixelDensity? | number | Texture density in px/metre, clamped 256–2048 at render time. Absent means the default: a defaulted field would count as a change on every instance of a prefab saved before it existed. | components/UIText.ts:57 |
style? | UiStyle | Modern styling; wins over the flat fields above. Absent until authored. | components/UIText.ts:59 |
variant? | | "body" | "caption" | "label" | "title" | "display" | "heading" | "value" | "badge" | Its role under a themed panel, which sets face, weight and colour: display, title, heading, body (the default), caption, label, value (a big number) or badge (a small pill). Size stays fontSize. | components/UIText.ts:65 |

