Adding Dialog #
Written by:
OmgRod
OwnerThe Dialog API allows you to trigger Geometry Dash's native cutscene dialogue system directly from your Lua scripts. When a dialogue opens, player movement is automatically paused until the dialogue sequence finishes.
Basic Usage #
To present a dialogue sequence, pass an array of speech frames to Dialog.show().
lua
1-- Example: Shop entry dialogue sequence2Dialog.show({3 {4 speaker = "Scratch",5 text = "Hello player!",6 avatar = 8,7 scale = 1.0,8 unskippable = false9 },10 {11 speaker = "Scratch",12 text = "Goodbye player!",13 avatar = 914 }15}, {16 bgType = 2,17 animateSide = true18})
API Reference #
Dialog.show(dialogList, [options]) #
Displays a sequence of interactive dialogue boxes.
Arguments #
dialogList(table): An array table where each element is a table containing the setup for an individual dialogue box.options(table, optional): A configuration table controlling overall dialogue presentation.
Dialogue Entry Options #
Each dialogue object in the dialogList array supports the following properties:
| Parameter | Type | Default | Description |
|---|---|---|---|
speaker | string | "" | The name displayed at the top of the dialogue box. |
text | string | "" | The text content to display. Supports GD dialogue tags (e.g., <d030>, <cr>). |
avatar | integer | 1 | The character avatar/portrait frame ID to render. |
scale | number | 1.0 | Text scale inside the dialogue box. |
unskippable | boolean | false | If set to true, the player cannot tap/click to skip this line immediately. |
color | table | {255, 255, 255} | An array containing RGB values {R, G, B} (0–255) to tint the main text. |
Global Presentation Options #
The optional second argument table controls how the dialogue UI layers into the scene:
| Parameter | Type | Default | Description |
|---|---|---|---|
bgType | integer | 2 | Background style for the dialogue layer (e.g., standard, darkened overlay). |
animateSide | boolean | true | When true, slides the dialogue box in randomly from either side of the screen upon opening. |
Text Formatting Tags #
Geometry Dash uses built-in text tags within dialogue strings to trigger color shifts, speed adjustments, and sound effects:
- Text Speed:
<d030>changes text delay (e.g.,030= 0.30s per letter). - Color Tags:
<cr>(Red),<cg>(Green),<cb>(Blue),<cy>(Yellow),<co>(Orange),<c#HEX>(Custom Hex Color). - Reset Color:
</c>resets text color back to default white. - Sound Effects:
<s100>plays a specific GD sfx ID when that word appears.</s>stops/resets current text sound settings.
