Skip to content

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.

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: string

Defined in: ui/core/text.ts:70


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: 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: number

Defined in: ui/core/text.ts:89


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: 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: number

Defined in: ui/core/text.ts:95


overflow: TextOverflow

Defined in: ui/core/text.ts:94


renderMode: TextRenderMode

Defined in: ui/core/text.ts:105


richText: boolean

Defined in: ui/core/text.ts:104


shadowBlur: number

Defined in: ui/core/text.ts:101


shadowColor: Color

Defined in: ui/core/text.ts:100


shadowOffsetX: number

Defined in: ui/core/text.ts:102


shadowOffsetY: number

Defined in: ui/core/text.ts:103


strokeColor: Color

Defined in: ui/core/text.ts:98


strokeWidth: number

Defined in: ui/core/text.ts:99


verticalAlign: TextVerticalAlign

Defined in: ui/core/text.ts:92


wordWrap: boolean

Defined in: ui/core/text.ts:93