You can register a custom text box using the
For more details, please refer to the source code of textbox.lua
In many cases you don’t even need to replace the default choice screen. The default implementation just shows a row of buttons with text on them. You can change the look of the buttons by altering
gui/button.png located in the
If you want to make more significant changes, you can register a completely custom choice screen using the
registerChoiceScreen function. For more details, please refer to the source code of choice.lua.
Like the choice screen, the easiest way to customize the built-in save-/load screens is to just alter the images it uses. In this case, the images are located in
To register custom save or load screens, you can use the
registerLoadScreen functions. For more details, please refer to the source code of savescreen.lua
To override the standard text log screen, use the
registerTextLogScreen function. For more details, please refer to the source code of textlog.lua
You can run custom code when the user tries to close the application window. The default behavior is to just immediately exit without saving, but you can override that to add an are-you-sure confirmation, auto-save, or just show a little shutdown animation.
To change the behavior, define a global function named
onExit as such:
On mobile platforms (Android, iOS) the
onExit function is never called.