Modules
A module is a script that can be loaded using require.
-- uikit is a module that can be used to build user interfaces. -- Here's how you can use it to display a button: uikit = require("uikit") local btn = uikit:createButton("this is a button") btn.onRelease = function() print("clicked") end
All modules follow these simple rules:
- When required, a module returns a single table
- Global variables can't be defined within modules (only local ones)
- When a module is required several times, the returned table is always the exact same reference
Currently, only modules packaged with the application can be used, they're all open-source and documented on this page.