NarraLeaf

Text

Self nodes for the nl.text widget — reading and writing content, typography, colour, and static effects.

The Text category is the Self node set of the nl.text widget: the string it shows, the typeface and metrics it shows it in, and the static effects layered on top. These nodes appear only in the palette of an nl.text element's own blueprint (widgetMain or componentWidgetMain), and every one of them acts on that element. The two widgets built on nl.text, nl.dialog.sentence and nl.nvl.texts, offer them too. To reach a different text element, use the blueprint.element.text.* node of the same name from the Element category — the same properties, plus an element:nl.text input to aim it.

Conventions

  • No target pin. A Self node has no Element input; it resolves its target from the blueprint's execution owner. There is nothing to wire, and nothing to aim at the wrong element.
  • Reads are Pure, writes are Latent. Every getter is side-effect free. Every setter suspends the graph while the host applies the patch.
  • Not available in a Blueprint Value. A Blueprint Value is owned by widgetValue and these nodes are scoped to widgetMain and componentWidgetMain, so the getters never appear in that palette even though they are pure. To read text properties from a Blueprint Value, use the Element-targeted getters with an Element literal.
  • Writes need a running game. The host API exists only under a blueprint runtime. On the editor canvas a setter fails with This node runs only in a running game. Open Dev Mode to run it., and a getter produces nothing at all.
  • Written words win. Words that Set Text, Append Text, Clear Text or the text pin of Set All Properties write while the game runs show as written in every language, ahead of a translation key, the translation of the element's own words and a Blueprint Value, until the page is opened again. A script layer's write does the same. The element's own words are its default value until the first write; see Interface text.
  • A write that changes nothing does nothing. Each setter normalizes its patch, compares it against the element's current properties, and returns early when they match — no repaint and no On Flush for that element. Words written for the first time are the exception: they are a change even when they equal the words on screen, because from then on they show as written in every language. Getters never queue a flush either, so a graph can poll properties without driving itself in a loop.
  • An unwired or unrecognised input is not "leave it alone". With no edge, nothing typed on the card, or a value outside the allowed set, most setters write a fixed fallback instead of keeping the current value: Set Text writes an empty string, Set Font clears the font, Set Font Size writes 16, Set Line Height writes 1.4, and each enum setter writes the first value of its list. Nothing is rejected and nothing throws. Only Set Text Color, Set Effects, and every pin of Set All Properties fall back to what the element already has.
  • Some nodes are grouped into families. While the palette is browsed, the nine style getters from Get Font to Get Effects are one row, Get Text Style, and their setters are Set Text Style; Get Visible and Get Enabled are Get Visible or Enabled, and Set Visible and Set Enabled are Set Visible or Enabled. A search finds each node by its own name, and the ▾ beside a placed card's title switches it to another node of its family. See Node families.

Get Text

blueprint.text.getText · Pure

Reads the words on screen: words written while the game runs; otherwise the words of the element's translation key, or its own words, in the player's current language; or the words a Blueprint Value or a list row's field gives.

PinDirectionTypeNotes
textout · datastring

Set Text

blueprint.text.setText · Latent

Replaces the whole string.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
textin · datastringWrites an empty string when nothing resolves. Accepts an on-card literal.

The words Set Text writes show as written in every language, also on a text whose source is Translation key or a Blueprint Value, until the page is opened again. To show a translated word, write the result of Get Text, and write it again after the player switches language, or show it through a Blueprint Value instead.

Append Text

blueprint.text.appendText · Latent

Reads the words on screen and writes them back with text on the end.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
textin · datastringAppended verbatim — no separator. Accepts an on-card literal.

Clear Text

blueprint.text.clearText · Latent

Writes an empty string. Identical to Set Text with nothing wired, but says so on the card.

PinDirectionTypeNotes
inin · exec—
nextout · exec—

Get Font

blueprint.text.getFont · Pure

Reads the id of the project font asset the element uses.

PinDirectionTypeNotes
fontAssetIdout · datastringEmpty string when no font asset is set and the element inherits the canvas default typeface.

Set Font

blueprint.text.setFont · Latent

Points the element at a project font asset.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
fontAssetIdin · datastringA blank or unresolved value clears the font and returns the element to the canvas default typeface. Accepts an on-card literal.

Get Font Size

blueprint.text.getFontSize · Pure

PinDirectionTypeNotes
fontSizeout · datafloatSurface design pixels.

Set Font Size

blueprint.text.setFontSize · Latent

PinDirectionTypeNotes
inin · exec—
nextout · exec—
fontSizein · datafloatClamped to at least 1; the inspector's 8–256 range does not apply to a blueprint write. Falls back to 16. Accepts an on-card literal.

Get Font Weight

blueprint.text.getFontWeight · Pure

PinDirectionTypeNotes
fontWeightout · datastringOne of normal, 600, bold.

Set Font Weight

blueprint.text.setFontWeight · Latent

The weight is a three-value enum, not a numeric CSS weight. 700 is not a synonym for bold here — it is outside the set, so it falls back to normal.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
fontWeightin · datastringnormal, 600, or bold — the string "600", not the number. Anything else falls back to normal. Accepts an on-card literal.

Get Text Color

blueprint.text.getTextColor · Pure

PinDirectionTypeNotes
colorout · dataRGBAColor

Set Text Color

blueprint.text.setTextColor · Latent

The element stores its colour as a CSS colour string; these pins convert in both directions, so the pin type is RGBAColor and not string.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
colorin · dataRGBAColorNo on-card literal — wire a colour constant from Data, or another node's RGBAColor output. Falls back to the current colour.

Get Text Align

blueprint.text.getTextAlign · Pure

PinDirectionTypeNotes
textAlignout · datastringOne of left, center, right.

Set Text Align

blueprint.text.setTextAlign · Latent

Aligns the lines horizontally inside the element's box. It does not move or resize the box.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
textAlignin · datastringleft, center, or right. Anything else falls back to left. Accepts an on-card literal.

Get Text Vertical Align

blueprint.text.getTextVerticalAlign · Pure

PinDirectionTypeNotes
textVerticalAlignout · datastringOne of start, center, end.

Set Text Vertical Align

blueprint.text.setTextVerticalAlign · Latent

Distributes the lines inside the element's box. It moves the text within the box; it does not resize the box.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
textVerticalAlignin · datastringstart, center, or end. Anything else falls back to start. Accepts an on-card literal.

Get Line Height

blueprint.text.getLineHeight · Pure

PinDirectionTypeNotes
lineHeightout · datafloatA unitless multiplier of the font size, not a pixel distance.

Set Line Height

blueprint.text.setLineHeight · Latent

PinDirectionTypeNotes
inin · exec—
nextout · exec—
lineHeightin · datafloatMultiplier, clamped to at least 0.1. Falls back to 1.4. Accepts an on-card literal.

Get Wrap Mode

blueprint.text.getWrapMode · Pure

PinDirectionTypeNotes
textWrapModeout · datastringOne of word, character, nowrap.

Set Wrap Mode

blueprint.text.setWrapMode · Latent

PinDirectionTypeNotes
inin · exec—
nextout · exec—
textWrapModein · datastringword breaks between words, character breaks inside them, nowrap never breaks. Anything else falls back to word. Accepts an on-card literal.

Get Effects

blueprint.text.getEffects · Pure

Reads the element's static effect block as one JSON object, always with every field present:

{
    "effectBlur": 0,
    "effectBackgroundBlur": 0,
    "effectShadow": null,
    "effectTextShadow": null,
    "effectInnerShadow": null,
    "effectBlend": "",
    "effectGlow": null,
    "effectFilter": null
}

A text element honours only effectBlur, effectTextShadow, effectBlend and effectFilter — it draws its shadow with CSS text-shadow, and the box-shadow fields belong to chrome widgets. effectShadow, effectInnerShadow and effectGlow therefore always read back as null on a text element.

PinDirectionTypeNotes
effectsout · datajson

Set Effects

blueprint.text.setEffects · Latent

Replaces the whole effect block — this is not a merge, so read with Get Effects and edit the object if you only mean to change one field.

Writing a box-shadow field is not silently dropped: on the next read, effectShadow (or, failing that, effectGlow) is promoted into effectTextShadow when no text shadow is set, and the box-shadow field itself comes back null. The shadow does appear, but not under the key you wrote it to.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
effectsin · datajsonMissing or malformed fields are filled from the defaults above, not from the current effects. Falls back whole to the current effects when nothing resolves.

Get All Properties

blueprint.text.getAllProperties · Pure

Every text property from one card. Each output carries exactly what its dedicated getter would return.

PinDirectionTypeNotes
textout · datastring
fontAssetIdout · datastringEmpty string when no font asset is set.
fontSizeout · datafloat
fontWeightout · datastring
colorout · dataRGBAColor
textAlignout · datastring
textVerticalAlignout · datastring
lineHeightout · datafloat
textWrapModeout · datastring
effectsout · datajson

Set All Properties

blueprint.text.setAllProperties · Latent

Writes every text property in one patch, so the element repaints once instead of ten times. It reads the current properties first and uses them as the fallback for every pin, which makes it the one setter where leaving a pin unwired keeps the current value — the opposite of the single-property setters. Left unwired and empty, text writes no words, so a keyed or bound text keeps following the player's language.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
textin · datastringAccepts an on-card literal.
fontAssetIdin · datastringAn explicit null still clears the font. Accepts an on-card literal.
fontSizein · datafloatClamped to at least 1. Accepts an on-card literal.
fontWeightin · datastringnormal, 600, or bold. Accepts an on-card literal.
colorin · dataRGBAColorNo on-card literal.
textAlignin · datastringleft, center, or right. Accepts an on-card literal.
textVerticalAlignin · datastringstart, center, or end. Accepts an on-card literal.
lineHeightin · datafloatMultiplier, clamped to at least 0.1. Accepts an on-card literal.
textWrapModein · datastringword, character, or nowrap. Accepts an on-card literal.
effectsin · datajsonNo on-card literal.

Get Visible

blueprint.text.getVisible · Pure

PinDirectionTypeNotes
visibleout · databoolean

Set Visible

blueprint.text.setVisible · Latent

Sets the element's visible property. This is not the same switch as Set Display in the Displayable category: display is the runtime render switch that hides the element and its subtree with CSS while keeping them mounted, whereas visible is the layout visibility property the inspector exposes.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
visiblein · databooleanNo on-card literal — wire a boolean. Falls back to the current value.

Get Enabled

blueprint.text.getEnabled · Pure

PinDirectionTypeNotes
enabledout · databoolean

Set Enabled

blueprint.text.setEnabled · Latent

false maps onto the underlying interaction-disable mechanism; the raw interactionDisabled property is not exposed to authors, so this pair is the whole interface.

PinDirectionTypeNotes
inin · exec—
nextout · exec—
enabledin · databooleanNo on-card literal — wire a boolean. Falls back to the current value.

On this page