UI functions#
The UI API allows to manipulate the user interface widgets from LUA scripts.
Some of those functions are registered as soon as scripting::Scripting
is constructed, while others have some preconditions for being available.
Generic UI functions#
Those functions are available as soon, as scripting::Scripting is
created.
- ui_createText()#
Creates a full-screen
text widget.- Returns:
Text widget ID.
- Return type:
number
- ui_textClear(id)#
Clears the contents of a text widget.
- Parameters:
id (
number) – Text widget ID.
- ui_textWrite(id, message, font, speed)#
Appends text to a text widget. Internally, finds the text widget with given ID, and calls
ui::Text::write().- Parameters:
id (
number) – Text widget ID.message (
str) – Text contents to append.font (
str) – Font face to be used.speed – Text typing speed.
Dialogue mode#
Dialogue mode allows for displaying a messages, optionally providing the speaker name, and presenting player with choices. Despite the name, they may be used for any interaction, for example observing an object, as long as a zoomed in view and a message are needed.
Mode management functions#
Those functions are available while the in-game mode
is active.
- dialogue_start()#
Starts the dialogue mode.
Game
Dialoguesub-mode is activated.When the dialogue mode is entered, a zoom-in animation is activated, and the screen remains zoomed in for the remainder of dialogue.
This registers the dialogue-related functions, described below. The standard player controls (movement, interaction, inventory access, etc.) are disabled until this mode is finished. The mode does not finish automatically, so if the script does not call the
dialogue_end()function, player will be stuck in this mode forever.
- dialogue_end()#
Ends the dialogue mode.
A zoom-out animation is activated, and standard player controls are restored.
Has no effect if the dialogue mode is not active.