SetText
These pages are not yet fully reviewed. The LUIDA team is continuing to review and improve them. If you find anything wrong on these pages, or have questions that aren't resolved by reading them, please ask or report to the LUIDA team.
SetText(text)StableItem Manipulation- Fires
- On State Start · During State · On State Exit
Description
Sets text on a child 'Text' sub-node.
Parameters
No parameters.
Side effects
- Calls
$.subNode("Text").setText(text)on the item. The item must have a child GameObject named exactlyTextwith aTextView(or compatible) component. - Purely visual — no state keys, no signals, no
$.groupState, nocallExternal. - If the
Textsub-node is missing or doesn't exposesetText, the runtime logs a warning (Error in SetText: ... Ensure a 'Text' sub-node exists and has setText method.) and continues; the action never throws.
Example
In Tutorial 3 (Stroop), the Instruction × Trial - Start cell uses two SetText actions, each gated on the request within-subject variable, so the displayed instruction adapts per trial:
// On State Start, gated by request === "font"
SetText("Click the button that matches the text's font color.");
// On State Start, gated by request === "meaning"
SetText("Click the button that matches the text's meaning.");The same item also calls ShowItem() on enter and HideItem() on exit so the text only appears during the active state. Combined with the if toggle in the editor, this is how LUIDA conditionalizes content without a Customized Action.
Related
SetChildPosition(childName, x, y, z)— the parent-vs-child pattern:SetTextwrites to the named sub-nodeText;SetChild*actions take a child name argument and are flexible by comparison.- Tutorial 2 → Instruction × Trial - Start — gated
SetTextfor per-condition instructions.