Screen Reader Announce
Speaks a message to screen-reader users through a visually hidden live region, with no visible UI, so wins, warnings and reel outcomes in a canvas-rendered slot are not silent. It runs only in the browser and is never compiled to the RGS.
A canvas-rendered slot has no DOM text for assistive technology to read, so announce what matters yourself. On Announce the node writes Text into a visually hidden aria-live region it creates once per instance in document.body. Announce is deferred until the inputs settle, so a Text set in the same update is what is spoken. The region is removed when the node is deleted.
Politeness decides how the reader delivers it. The default polite gives the region the status role, so the message waits for the reader to pause; the interrupting option gives it the alert role and cuts in immediately, so keep it for balance and limit warnings. Changing Politeness re-labels the existing region at once. Clear After (default 3000 ms) empties the region afterwards; 0 leaves the text in place.
Screen readers ignore a live region whose content did not change, so announcing the same text twice blanks the region and re-sets it 50 ms later. A new announcement cancels the previous clear timer. Announcing an empty Text clears the region but still counts. Without a DOM (tests, server-side runs) nothing is spoken, yet Last Announcement, Announced Count and Announced still update, so a chain wired after the node keeps running.
Typical wiring: Win Rollup finished to Announce with its formatted text as Text; Reality Check due and Session Limits limitReached to an interrupting instance; Reel Stop Watcher allStopped to announce the round result, built with String Format. Because Politeness re-labels the node's one region, use a second instance for the warnings rather than switching the input back and forth.
Inputs
Actions
| Signal | Description |
|---|---|
| Announce | Speaks the current Text. Deferred until inputs settle, so a Text set in the same update is what is announced. |
Message
| Data | Description |
|---|---|
| Text (string) | The message to speak, for example a formatted You won 12.50. Default empty; announcing empty text clears the region but still counts. |
| Politeness (enum) | How urgently the reader delivers it. Default polite (the status role) waits for a pause; the interrupting option (the alert role) is for warnings only. Options: polite, assertive. |
| Clear After (ms, 0 = keep) (number) | ms after an announcement before the hidden region is emptied. Default 3000; 0 leaves the text in place. |
Outputs
State
| Data | Description |
|---|---|
| Last Announcement (string) | The text most recently announced; updates even without a DOM. |
| Announced Count (number) | How many Announce signals the node has handled since it was created. |
Events
| Signal | Description |
|---|---|
| Announced | Fires after each announcement, with or without a DOM, so a chain after the node keeps running. |
Usage
- Add the node once for ordinary messages and once more, set to the interrupting politeness, for warnings.
- Wire Win Rollup
finishedto Announce on the polite instance, with itstextoutput as Text. - Wire Reel Stop Watcher
allStoppedto Announce with a result string from String Format. - Wire Reality Check
dueand Session LimitslimitReachedto Announce on the interrupting instance. - Leave Clear After at
3000unless the text must stay for the reader to revisit.
The interrupting politeness cuts off whatever the reader is saying. Use it only for messages the player must hear now, such as balance and limit warnings, and keep wins and reel results on polite.