Skip to main content
The Dialog namespace gives you three distinct ways to present text to the player during a level: messages that require a button press to dismiss, messages that disappear on their own after a fixed duration, and messages whose entire lifecycle your script controls manually. Choosing the right type makes your level feel polished and purposeful.

Message Types at a Glance


Closeable Messages

A closeable message blocks the player’s attention until they actively dismiss it. Use this whenever the player must read a message before continuing.

Signatures

Dialog.createCloseable displays the message immediately. Dialog.openCloseable is used to re-show a previously created message using the ID returned from creation.

Example — Tutorial at Level Start

Attach this script to the Level entity. The OnStart hook fires as soon as the level loads.
Keep closeable messages short — one or two sentences. If you need to show a series of instructions, chain multiple calls inside Level.delayAction to space them out.

Temporary Messages

A temporary message shows itself and then automatically vanishes after the number of seconds you specify. The player never needs to interact with it.

Signatures

The duration parameter is measured in seconds.

Example — Countdown Warning

This script runs in the Level OnUpdate hook and shows a warning when the hourglass drops below 15 seconds.
The warningSent guard prevents the message from re-firing every frame once the threshold is crossed. Always use a flag like this with OnUpdate.

Manual Messages

Manual messages give you complete control. You create the dialog with an ID, open and close it whenever you like, and destroy it when you no longer need it.

Signatures

The dialogId is a unique string key that identifies this dialog in your script. The messageId is the identifier of the specific message content to display inside it.

Example — Scripted Story Dialog Sequence

This script is attached to a Block entity. When the ball rolls onto the block (OnBallRoll with rollIn = true), it kicks off a three-part dialog sequence using Level.delayAction to pace the lines.
Always call Dialog.existsManual before Dialog.destroyManual. If the dialog has already been cleaned up (for example, by a restart), calling destroy on a non-existent ID will produce an error.

Customising Background Colors

Every create* and open* function accepts an optional Color as its last argument. Colors are RGBA values in the 0.01.0 range.
When you omit the color argument, the game uses a solid black background.
A semi-transparent background (alpha around 0.8) lets the player see the level behind the dialog, which feels less intrusive for short temporary messages.