Skip to content
Stjepan Bakrac edited this page May 22, 2020 · 3 revisions

This section contains reference information about the custom Lua libraries available with Windower.

About Function Signatures

Function signatures in the Library Reference are specified with some additional information about parameter types and default values.

Example: ui.button function signature

function ui.button(id : string, text : string, checked : boolean = false, enabled : boolean = true) : boolean

From this example, we can see that the function takes four parameters:

  • id : a string
  • text : a string
  • checked : an optional boolean value that defaults to false
  • enabled : an optional boolean value that defaults to true

We can also see that the function itself returns a single boolean value.

By removing all the additional parameter type information from the signature, we are left with valid Lua syntax. For example, removing : string from the id parameter, and so on, gives us this:

Example: ui.button function signature, with type information removed

function ui.button(id, text, checked, enabled)

This function definition can be used to assign the return value to a variable in standard Lua:

Example: ui.button Lua usage

local button_checked = ui.button(id, text, checked, enabled)
Clone this wiki locally