Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

iui.checkbox

A widget that toggles boolean values.

newValue = iui.checkbox(name, currentValue)

Arguments

NameTypeDescription
namestringThe ID. Displayed as the checkbox’s text.
currentValuebooleanThe existing value for the checkbox.

Returns

NameTypeDescription
newValuebooleanThe new value for the checkbox.

Overview

If the user presses a checkbox, newValue will be the inverse of currentValue, otherwise it’ll be the same. Typically, you’ll have one boolean variable that you both pass to the method and assign its return value to.

local value = true

local function updateUI()
	value = iui.checkbox("Some Checkbox", value)
end