Skip to content

TextInit

Defined in: ui/core/compose.ts:142

optional align?: TextAlign

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

TextData.align


optional bold?: boolean

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

TextData.bold


optional color?: Color

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

TextData.color


optional content?: string

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

TextData.content


optional enabled?: boolean

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

Render toggle — the editor’s eye and runtime hiding both flip this.

TextData.enabled


optional 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.

TextData.font


optional 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.

TextData.fontFamily


optional fontSize?: number

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

TextData.fontSize


optional 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.

TextData.i18nKey


optional italic?: boolean

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

TextData.italic


optional 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.

TextData.layer


optional lineHeight?: number

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

TextData.lineHeight


optional overflow?: TextOverflow

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

TextData.overflow


optional renderMode?: TextRenderMode

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

TextData.renderMode


optional richText?: boolean

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

TextData.richText


optional shadowBlur?: number

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

TextData.shadowBlur


optional shadowColor?: Color

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

TextData.shadowColor


optional shadowOffsetX?: number

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

TextData.shadowOffsetX


optional shadowOffsetY?: number

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

TextData.shadowOffsetY


optional strokeColor?: Color

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

TextData.strokeColor


optional strokeWidth?: number

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

TextData.strokeWidth


optional verticalAlign?: TextVerticalAlign

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

TextData.verticalAlign


optional wordWrap?: boolean

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

TextData.wordWrap