TextData
Defined in: ui/core/text.ts:69
Text’s fields. Alignment and overflow read differently with and
without a layout box — see TextAlign and TextOverflow.
Properties
Section titled “Properties”align:
TextAlign
Defined in: ui/core/text.ts:91
bold:
boolean
Defined in: ui/core/text.ts:96
color:
Color
Defined in: ui/core/text.ts:90
content
Section titled “content”content:
string
Defined in: ui/core/text.ts:70
enabled
Section titled “enabled”enabled:
boolean
Defined in: ui/core/text.ts:122
Render toggle — the editor’s eye and runtime hiding both flip this.
font:
number
Defined in: ui/core/text.ts:85
A font asset the game SHIPS (.ttf / .otf / .woff). When set it wins
over fontFamily: the loader registers the file with the platform’s
text stack and this handle resolves back to that family. Leave it empty to
name a font the host already has, through fontFamily.
fontFamily
Section titled “fontFamily”fontFamily:
string
Defined in: ui/core/text.ts:88
Font family resolved by the platform’s text stack — a font the HOST already has. For a font you ship, use font instead.
fontSize
Section titled “fontSize”fontSize:
number
Defined in: ui/core/text.ts:89
i18nKey
Section titled “i18nKey”i18nKey:
string
Defined in: ui/core/text.ts:78
Localization key. Non-empty ⇒ content is DERIVED: every frame the
text-localization system resolves the key through the app’s Localization
resource (opt-in plugin) and writes the result into content, so a
setLocale re-flows every bound label. Empty (default) or no
Localization resource ⇒ content stands as authored.
italic
Section titled “italic”italic:
boolean
Defined in: ui/core/text.ts:97
layer:
number
Defined in: ui/core/text.ts:120
Draw layer, for a text with NO layout box — a label standing in the world rather than inside a Canvas. It is read the same way Sprite.layer and ShapeRenderer.layer are, so a label can be put in front of (or behind) the world content around it.
Ignored under a UINode: inside a Canvas the UI render order decides, and a second knob there would let a text sort against its own panel.
It exists because world text was pinned to layer 0 with no way off it, so any ShapeRenderer or Sprite that also sat on layer 0 and drew later simply covered it — a board hiding its own pieces, a name tag behind the character it names — with nothing in the component to reach for.
lineHeight
Section titled “lineHeight”lineHeight:
number
Defined in: ui/core/text.ts:95
overflow
Section titled “overflow”overflow:
TextOverflow
Defined in: ui/core/text.ts:94
renderMode
Section titled “renderMode”renderMode:
TextRenderMode
Defined in: ui/core/text.ts:105
richText
Section titled “richText”richText:
boolean
Defined in: ui/core/text.ts:104
shadowBlur
Section titled “shadowBlur”shadowBlur:
number
Defined in: ui/core/text.ts:101
shadowColor
Section titled “shadowColor”shadowColor:
Color
Defined in: ui/core/text.ts:100
shadowOffsetX
Section titled “shadowOffsetX”shadowOffsetX:
number
Defined in: ui/core/text.ts:102
shadowOffsetY
Section titled “shadowOffsetY”shadowOffsetY:
number
Defined in: ui/core/text.ts:103
strokeColor
Section titled “strokeColor”strokeColor:
Color
Defined in: ui/core/text.ts:98
strokeWidth
Section titled “strokeWidth”strokeWidth:
number
Defined in: ui/core/text.ts:99
verticalAlign
Section titled “verticalAlign”verticalAlign:
TextVerticalAlign
Defined in: ui/core/text.ts:92
wordWrap
Section titled “wordWrap”wordWrap:
boolean
Defined in: ui/core/text.ts:93