Skip to main content

Dialog

The dialog interface

Dialog.plain { text = "Hello, World!" }

Properties

result

Dialog.result: number

Get the result (choice) of the last dialog

Functions

wait

Dialog.wait() → number--

result of last dialog (choice)

Waits until all dialogs are closed

plain

Dialog.plain(
optionstable | nil--

settings

) → ()

New plain text dialog

If table is nil, no dialog will be created.

Options

Name Type Default Description
text string ? Dialog text contents / choices
instant bool false Skip animations
pos string Center Dialog position identifier

Positions

Name Description
center Center of screen
bottom Bottom of screen
bottom_full Full width bottom of screen
top Top of screen
top_full Full width top of screen
left Left of screen
left_full Full height left of screen
left_bottom Bottom part left of screen
left_top Top part left of screen
right Right of screen
right_full Full height right of screen
right_bottom Bottom part right of screen
right_top Top part right of screen

chara

Dialog.chara(
optionstable | nil--

settings

) → ()

New character dialog

If table is nil, no dialog will be created.

Options

Name Type Default Description
text string ? Dialog text contents / choices
chara string - Character identifier
name string - Character name override
skin string - Skin identifier override
pos string Center Dialog position identifier

If chara is "self", then skin is set to the current player skin.

Positions

Name Description
center Center of screen
bottom Bottom of screen
bottom_full Full width bottom of screen
top Top of screen
top_full Full width top of screen
left Left of screen
left_full Full height left of screen
right Right of screen
right_full Full height right of screen

inline

Dialog.inline(
optionstable | nil--

settings

) → ()

New inline dialog

If table is nil, no dialog will be created.

Options

Name Type Default Description
text string ? Dialog text contents / choices
x number 79 Horizontall center (screen)
y number 44 Vertical center (screen)
Show raw api
{
    "functions": [
        {
            "name": "wait",
            "desc": "Waits until all dialogs are closed",
            "params": [],
            "returns": [
                {
                    "desc": "result of last dialog (choice)",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 16,
                "path": "../../res/data/script/lib/system/dialog.lua"
            }
        },
        {
            "name": "plain",
            "desc": "New plain text dialog\n\nIf table is nil, no dialog will be created.\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| text            | string      |       ? | Dialog text contents / choices |\n| instant         | bool        |   false | Skip animations                |\n| pos             | string      |  Center | Dialog position identifier     |\n\n### Positions\n| Name           | Description                  |\n|----------------|------------------------------|\n| center         | Center of screen             |\n| bottom         | Bottom of screen             |\n| bottom_full    | Full width bottom of screen  |\n| top            | Top of screen                |\n| top_full       | Full width top of screen     |\n| left           | Left of screen               |\n| left_full      | Full height left of screen   |\n| left_bottom    | Bottom part left of screen   |\n| left_top       | Top part left of screen      |\n| right          | Right of screen              |\n| right_full     | Full height right of screen  |\n| right_bottom   | Bottom part right of screen  |\n| right_top      | Top part right of screen     |",
            "params": [
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table | nil"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 58,
                "path": "../../res/data/script/lib/system/dialog.lua"
            }
        },
        {
            "name": "chara",
            "desc": "New character dialog\n\nIf table is nil, no dialog will be created.\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| text            | string      |       ? | Dialog text contents / choices |\n| chara           | string      |       - | Character identifier           |\n| name            | string      |       - | Character name override        |\n| skin            | string      |       - | Skin identifier override       |\n| pos             | string      |  Center | Dialog position identifier     |\n\nIf `chara` is `\"self\"`, then `skin` is set to the current player skin.\n\n\n### Positions\n| Name           | Description                  |\n|----------------|------------------------------|\n| center         | Center of screen             |\n| bottom         | Bottom of screen             |\n| bottom_full    | Full width bottom of screen  |\n| top            | Top of screen                |\n| top_full       | Full width top of screen     |\n| left           | Left of screen               |\n| left_full      | Full height left of screen   |\n| right          | Right of screen              |\n| right_full     | Full height right of screen  |",
            "params": [
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table | nil"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 93,
                "path": "../../res/data/script/lib/system/dialog.lua"
            }
        },
        {
            "name": "inline",
            "desc": "New inline dialog\n\nIf table is nil, no dialog will be created.\n\n### Options\n| Name            | Type        | Default | Description                    |\n|-----------------|-------------|---------|--------------------------------|\n| text            | string      |       ? | Dialog text contents / choices |\n| x               | number      |      79 | Horizontall center (screen)    |\n| y               | number      |      44 | Vertical center (screen)       |",
            "params": [
                {
                    "name": "options",
                    "desc": "settings",
                    "lua_type": "table | nil"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 110,
                "path": "../../res/data/script/lib/system/dialog.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "result",
            "desc": "Get the result (choice) of the last dialog",
            "lua_type": "number",
            "source": {
                "line": 25,
                "path": "../../res/data/script/lib/system/dialog.lua"
            }
        }
    ],
    "types": [],
    "name": "Dialog",
    "desc": "The dialog interface\n\n```lua\nDialog.plain { text = \"Hello, World!\" }\n```",
    "source": {
        "line": 9,
        "path": "../../res/data/script/lib/system/dialog.lua"
    }
}