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. TheOnStart hook fires as soon as the level loads.
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
duration parameter is measured in seconds.
Example — Countdown Warning
This script runs in the LevelOnUpdate 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
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.
Customising Background Colors
Everycreate* and open* function accepts an optional Color as its last argument. Colors are RGBA values in the 0.0–1.0 range.