The SDK of this version is still being tested, and these pages are being updated with it: names, menus and procedures may still change before the release. If you build content for a platform already in production, follow the documentation of that version — pick it from the version menu at the top right.
UI Nodes
These nodes show toasts and popups over the world and read the colours of the Virtuademy theme. They are the graph side of IVirtuademyGameplay.Current.UI: see Toasts and popups for how they behave.
Flow Nodes
Show Toast Node
🔍
Virtuademy>Flow>Virtuademy UI: Show Toast
This Node shows a short message that closes by itself.
- ⬇️ Input:
- Text (
string), the message. Empty text shows nothing. - Severity (
EToastSeverity),Info(default),Success,WarningorError: the colour of the toast's accent bar. - Duration (
float), seconds on screen.0(default) uses the host's default, 3 seconds.
- Text (
At most three toasts are on screen: a fourth makes the oldest leave. The text is shown as given: to show it in the user's language, feed it with the Translate Or node.
Show Popup Node
🔍
Virtuademy>Flow>Virtuademy UI: Show Popup
This Node shows a modal popup with up to three buttons. The flow continues twice: at once through Shown, and when the popup closes through Closed.
-
⬇️ Input:
- Title (
string), the heading. - Text (
string), the body. - Button1 (
string), the first button (defaultOK). With only this one, it is the primary button. - Button2, Button3 (
string), the second and third buttons. Empty: none. The last one that has a text is the primary button. - CloseOnOutsideClick (
bool), a click or tap outside the popup closes it, with ButtonIndex -1. Off by default. - AutoCloseSeconds (
float), the popup closes by itself after this time, with ButtonIndex -1.0(default): never.
- Title (
-
⬆️ Output:
- Shown (control), runs as soon as the popup is shown.
- Closed (control), runs when the popup closes. It starts a new flow of the same graph.
- ButtonIndex (
int), the button that closed it, counted from 0 over the buttons that have a text, in the order of the inputs; -1 when it closed without one (another popup replaced it, Close Popup closed it, an outside click, its timer, the scene was unloaded, or nothing could draw it). Read it from Closed. - PopupId (
int), the id of this popup, for Close Popup. It is set before Shown runs.
Only one popup is open at a time: a new one closes the open one, and Closed of the first runs with -1. Closed and ButtonIndex always answer for the popup that this node opened, never for a later one.
In a graph, put a Branch or a Switch on ButtonIndex after Closed to act on the answer.
Close Popup Node
🔍
Virtuademy>Flow>Virtuademy UI: Close Popup
This Node closes a popup. Its Closed flow, if it had one, runs with ButtonIndex -1.
- ⬇️ Input:
- PopupId (
int), the PopupId that Show Popup gave.0(default) closes whichever popup is open.
- PopupId (
A popup that is already closed, or that another popup has replaced, is left alone when you give its id. To close a popup after a time, use AutoCloseSeconds of Show Popup, not a delay followed by Close Popup with 0: that closes whichever popup is open at that moment.
Get Nodes
Get Theme Color Node
🔍
Virtuademy>Get>Virtuademy UI: Get Theme Color
This Node returns the colour that the theme gives a role right now: the tenant's when the application published one for that role, the SDK default otherwise (also outside the application). Use it for what is not a themed panel: a material, a light, a line.
-
⬇️ Input:
- Role (
EThemeRole),Surface,SurfaceRaised,Border,Text,TextSecondary,Action(default),OnAction,Success,Warning,Error,InfoorScrim. The roles are described in Theme.
- Role (
-
⬆️ Output:
- Color (
Color), the colour of the role.
- Color (
The node reads the colour when the flow asks for it: to follow a change, read it again after the application publishes a new palette (a script has the ThemeChanged event).