Skip to content

@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 ​

ParameterType
options?UITextOptions

Returns ​

UITextComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDescriptionDefined in
textstring-components/UIText.ts:31
widthnumberLayout box width in metres — wrap happens against this.components/UIText.ts:33
heightnumberLayout box height in metres — overflow clamps to it.components/UIText.ts:35
fontSizenumberGlyph height in metres.components/UIText.ts:37
fontWeightnumberCSS font weight (400 normal, 600 semibold…).components/UIText.ts:39
colorstring-components/UIText.ts:40
alignUiTextAlign-components/UIText.ts:41
valignUiTextVAlign-components/UIText.ts:42
lineHeightnumberUnitless multiplier over fontSize.components/UIText.ts:44
paddingnumberInner padding in metres.components/UIText.ts:46