Skip to main content

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): void

Sets the text value. When animate=true (or animateNumber is set in config), numeric values count up/down over 500ms.


setOffset

setOffset(boneName: string, offset: { x: number; y: number }): void

Moves a text node by the given pixel offset relative to its bone position.


setMaxWidth

setMaxWidth(boneName: string, maxWidth: number): void

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"]>): void

Applies a partial Pixi.js TextStyle to the named text node.


setTextType

setTextType(boneName: string, newType: "text" | "bitmapText"): void

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.