@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / UITextComponent
Class: UITextComponent ​
Defined in: components/UIText.ts:30
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:48
Parameters ​
| Parameter | Type |
|---|---|
options? | UITextOptions |
Returns ​
UITextComponent
Overrides ​
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
text | string | - | components/UIText.ts:31 |
width | number | Layout box width in metres — wrap happens against this. | components/UIText.ts:33 |
height | number | Layout box height in metres — overflow clamps to it. | components/UIText.ts:35 |
fontSize | number | Glyph height in metres. | components/UIText.ts:37 |
fontWeight | number | CSS font weight (400 normal, 600 semibold…). | components/UIText.ts:39 |
color | string | - | components/UIText.ts:40 |
align | UiTextAlign | - | components/UIText.ts:41 |
valign | UiTextVAlign | - | components/UIText.ts:42 |
lineHeight | number | Unitless multiplier over fontSize. | components/UIText.ts:44 |
padding | number | Inner padding in metres. | components/UIText.ts:46 |

