Alert Dialog
Simple alert dialog that can display a message to the player. Returns whether the player pressed the confirm button or canceled the dialog.
lib.alertDialog
lib.alertDialog(data)data:
table(object)header:
stringDialog title.
content:
stringDialog body content, supports markdown.
centered?:
booleanCenters the dialog vertically and horizontally.
cancel?:
booleanDisplays a cancel button (ESC is still available if this is not defined).
size?:
'xs'or'sm'or'md'or'lg'or'xl'overflow?:
booleanlabels?:
tableAllows you to define the displayed labels for cancel and/or confirm buttons.
cancel?:
stringconfirm?:
string
Returns confirm if the player pressed the confirm button, otherwise if the player pressed the cancel button or has exited the dialog with ESC the return will be cancel.
lib.closeAlertDialog
Force closes the active alert dialog and sets its return data as nil
lib.closeAlertDialog()Example:
local alert = lib.alertDialog({
header = 'Hello there',
content = 'General Kenobi \n Markdown support!',
centered = true,
cancel = true
})
print(alert)Last updated