TextInit
此内容尚不支持你的语言。
Defined in: ui/core/compose.ts:142
Extends
Section titled “Extends”Partial<TextData>
Properties
Section titled “Properties”align?
Section titled “align?”
optionalalign?:TextAlign
Defined in: ui/core/text.ts:91
Inherited from
Section titled “Inherited from”
optionalbold?:boolean
Defined in: ui/core/text.ts:96
Inherited from
Section titled “Inherited from”color?
Section titled “color?”
optionalcolor?:Color
Defined in: ui/core/text.ts:90
Inherited from
Section titled “Inherited from”content?
Section titled “content?”
optionalcontent?:string
Defined in: ui/core/text.ts:70
Inherited from
Section titled “Inherited from”enabled?
Section titled “enabled?”
optionalenabled?:boolean
Defined in: ui/core/text.ts:122
Render toggle — the editor’s eye and runtime hiding both flip this.
Inherited from
Section titled “Inherited from”
optionalfont?: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.
Inherited from
Section titled “Inherited from”fontFamily?
Section titled “fontFamily?”
optionalfontFamily?: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.
Inherited from
Section titled “Inherited from”fontSize?
Section titled “fontSize?”
optionalfontSize?:number
Defined in: ui/core/text.ts:89
Inherited from
Section titled “Inherited from”i18nKey?
Section titled “i18nKey?”
optionali18nKey?: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.
Inherited from
Section titled “Inherited from”italic?
Section titled “italic?”
optionalitalic?:boolean
Defined in: ui/core/text.ts:97
Inherited from
Section titled “Inherited from”layer?
Section titled “layer?”
optionallayer?: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.
Inherited from
Section titled “Inherited from”lineHeight?
Section titled “lineHeight?”
optionallineHeight?:number
Defined in: ui/core/text.ts:95
Inherited from
Section titled “Inherited from”overflow?
Section titled “overflow?”
optionaloverflow?:TextOverflow
Defined in: ui/core/text.ts:94
Inherited from
Section titled “Inherited from”renderMode?
Section titled “renderMode?”
optionalrenderMode?:TextRenderMode
Defined in: ui/core/text.ts:105
Inherited from
Section titled “Inherited from”richText?
Section titled “richText?”
optionalrichText?:boolean
Defined in: ui/core/text.ts:104
Inherited from
Section titled “Inherited from”shadowBlur?
Section titled “shadowBlur?”
optionalshadowBlur?:number
Defined in: ui/core/text.ts:101
Inherited from
Section titled “Inherited from”shadowColor?
Section titled “shadowColor?”
optionalshadowColor?:Color
Defined in: ui/core/text.ts:100
Inherited from
Section titled “Inherited from”shadowOffsetX?
Section titled “shadowOffsetX?”
optionalshadowOffsetX?:number
Defined in: ui/core/text.ts:102
Inherited from
Section titled “Inherited from”shadowOffsetY?
Section titled “shadowOffsetY?”
optionalshadowOffsetY?:number
Defined in: ui/core/text.ts:103
Inherited from
Section titled “Inherited from”strokeColor?
Section titled “strokeColor?”
optionalstrokeColor?:Color
Defined in: ui/core/text.ts:98
Inherited from
Section titled “Inherited from”strokeWidth?
Section titled “strokeWidth?”
optionalstrokeWidth?:number
Defined in: ui/core/text.ts:99
Inherited from
Section titled “Inherited from”verticalAlign?
Section titled “verticalAlign?”
optionalverticalAlign?:TextVerticalAlign
Defined in: ui/core/text.ts:92
Inherited from
Section titled “Inherited from”wordWrap?
Section titled “wordWrap?”
optionalwordWrap?:boolean
Defined in: ui/core/text.ts:93