Skip to main content
The 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

Many Dialog functions accept a Color parameter for the background. You can use any of the built-in named colors or construct a custom one. To create a custom color, use Color.new(r, g, b) or Color.new(r, g, b, a) where each component is a number in the range 0.01.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 after duration 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 with Dialog.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.

Usage Examples

Closeable welcome message

Temporary status notification

Manual countdown dialog