TextsController
Creates and manages dynamic Pixi.js Text/BitmapText nodes attached to Spine slots. Accessed via layout.texts.
Methods
getInstances
getInstances(): Map<SpineID, Text | BitmapText>
Returns all active text instances (both Text and BitmapText) keyed by bone name.
getBitmapInstances
getBitmapInstances(): Map<SpineID, BitmapText>
Returns only the BitmapText instances, keyed by bone name.
getBySpine
getBySpine(): Map<string, string[]>
Returns a map of spineID → list of text slot names for each spine that has text slots.
getVal
getVal(textID: string): string | undefined
Returns the current string value of a text node by its bone name.
set
set(boneName: string, text: string, animate?: boolean)
Sets the text value. When animate=true (or animateNumber is set in config), numeric values count up/down over 500ms.
settle
settle(boneName: string, text: string)
Writes the value at once, whatever animateNumber says, and cuts short any count-up running on the field — for a figure the player has skipped to the end of. Fires the same <textKey>_change event set does.
setOffset
setOffset(boneName: string, offset: { x: number; y: number })
Moves a text node by the given pixel offset relative to its bone position.
setMaxWidth
setMaxWidth(boneName: string, maxWidth: number)
Constrains a text node to a max pixel width by scaling it down uniformly when it overflows.
setStyle
setStyle(boneName: string, style: Partial<Text["style"]>)
Applies a partial Pixi.js TextStyle to the named text node.
setTextType
setTextType(boneName: string, newType: "text" | "bitmapText")
Swaps a text node between Text and BitmapText at runtime, preserving its current value.
settings (setter)
set settings(settings: Record<string, TextsJsonEntry>)
Overrides the text configuration loaded from settings/texts.json.