Skip to content

Class: TextComponent ​

Rendered via the backend's ITextRenderer. Font resolution: registered fontAssetId wins (TTF/OTF

Font-face ​

or bitmap font); otherwise fontFamily is treated as a system font.

Extends ​

Constructors ​

Constructor ​

ts
new TextComponent(
   text?, 
   fontAssetId?, 
   fontFamily?, 
   fontSize?, 
   color?, 
   align?, 
   lineHeight?, 
   wrapEnabled?, 
   shrinkToFit?, 
   crispText?, 
   stroke?, 
   strokeColor?, 
   strokeWidth?, 
   dropShadow?, 
   dropShadowColor?, 
   dropShadowBlur?, 
   dropShadowDistance?
): TextComponent;

Parameters ​

ParameterTypeDefault value
textstring""
fontAssetIdstring | Font""
fontFamilystring"sans-serif"
fontSizenumber24
colorColorSource0xFFFFFF
alignTextAlignTextAlign.Left
lineHeightnumber40
wrapEnabledbooleanfalse
shrinkToFitbooleanfalse
crispTextbooleanfalse
strokebooleanfalse
strokeColorColorSource0x000000
strokeWidthnumber2
dropShadowbooleanfalse
dropShadowColorColorSource0x000000
dropShadowBlurnumber2
dropShadowDistancenumber4

Returns ​

TextComponent

Overrides ​

Component.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionInherited from
alignpublicTextAlignundefined--
colorpublicColorSourceundefined--
crispTextpublicbooleanundefined--
dirtypublicbooleantrue-Component.dirty
dropShadowpublicbooleanundefined--
dropShadowBlurpublicnumberundefined--
dropShadowColorpublicColorSourceundefined--
dropShadowDistancepublicnumberundefined--
enabledpublicbooleantrue-Component.enabled
fontAssetIdpublicstringundefined--
fontFamilypublicstringundefined--
fontSizepublicnumberundefined--
lineHeightpublicnumberundefined--
materialpublicstringundefinedMaterial slot (MaterialFields.ts).-
materialValuespublicRecord<string, unknown>undefined--
shrinkToFitpublicbooleanundefined--
strokepublicbooleanundefined--
strokeColorpublicColorSourceundefined--
strokeWidthpublicnumberundefined--
textpublicstringundefined--
wrapEnabledpublicbooleanundefined--

Accessors ​

font ​

Get Signature ​

ts
get font(): Font;
Returns ​

Font

Set Signature ​

ts
set font(f): void;
Parameters ​
ParameterType
fFont
Returns ​

void

© 2026 PlayAdGentic