Dialog namespace lets you display overlay messages to the player during gameplay. There are three message types: closeable messages that the player dismisses with a button press, temporary messages that disappear automatically after a set duration, and manual messages that you control entirely from Lua — opening and closing them yourself at any time. Every function accepts an optional Color for the background panel; when omitted the background defaults to black.
Color
ManyDialog functions accept a Color parameter for the background. You can use any of the built-in named colors or construct a custom one.
| Constant | Description |
|---|---|
Color.black | Default background (no argument needed). |
Color.red | Red background. |
Color.green | Green background. |
Color.blue | Blue background. |
Color.white | White background. |
Color.yellow | Yellow background. |
Color.cyan | Cyan background. |
Color.magenta | Magenta background. |
Color.gray | Gray background. |
Color.new(r, g, b) or Color.new(r, g, b, a) where each component is a number in the range 0.0–1.0.
Closeable Messages
A closeable message stays on screen until the player explicitly dismisses it. Use it for important instructions that must be acknowledged.Dialog.createCloseable
Creates and immediately displays a new closeable message.
Dialog.openCloseable
Displays a closeable message whose content is stored in the level’s message database under messageId.
Temporary Messages
A temporary message disappears automatically afterduration seconds. Use it for non-critical hints or status updates.
Dialog.createTemporary
Creates and immediately displays a new temporary message.
Dialog.openTemporary
Displays a temporary message from the level message database.
Manual Messages
A manual message persists until you explicitly close it withDialog.destroyManual. You identify the dialog by a dialogId string that you choose. This gives you full programmatic control over when messages appear and disappear.
Dialog.createManual
Creates a new manual dialog and immediately shows it.
Dialog.openManual
Shows a manual dialog using a pre-existing dialogId and a message from the level’s message database.
Dialog.existsManual
Returns true if a manual dialog with the given dialogId is currently active.
Dialog.destroyManual
Closes and removes the manual dialog with the given dialogId.
Calling
Dialog.destroyManual on a dialogId that does not exist is a no-op; it will not raise an error.