Skip to content
zetaepyon edited this page Jul 1, 2018 · 27 revisions

The user interface library renders widgets over the game window using an immediate-mode GUI.

local ui = require('ui')

The ui table has the following entries:

General Functions

Widget Functions

Tables


General Functions

ui.display

Definition

// TypeScript formatted function definition
function libname.tablename.entry1(param1 : type1, param2 : type2 = 'default_value') : return_type

Parameters

param1 type1

Description of parameter 1

param2 type2 [default: default_value]

Indicates the source of the command.

-- Lua example if necessary

Return

entry1 return_type

Description of whatever the function returns.



ui.window

Renders a graphical window that contains other widgets and is configured with based on optional configuration parameters defined in the state table.

Definition

function ui.window(id : string, state : window_state, fn : function) : window_state, boolean

Parameters

id string

Unique string identifier for the window.

state window_state

A table containing the configuration state of the window.

fn function

The function that defines the UI widgets drawn within the window.

Note: Widgets created inside a window are positioned relative to the extents of the window, not the entire game screen as with widgets created directly inside the ui.display function.



ui.location



ui.size



ui.space



ui.unindent



ui.indent



Widget Functions

ui.button

Description of the function that is the first table entry.



ui.check



ui.color_picker



ui.edit



ui.image



ui.progress



ui.radio



ui.slider



ui.text



Clone this wiki locally