Skip to content
Caldas Lopes edited this page Jun 2, 2020 · 3 revisions

Information

A standard checkbox

Example Use

local checkbox = loveframes.Create("checkbox")

Event Callbacks

OnChanged

Called every time the object becomes checked or unchecked

Arguments passed: self [object], checked [boolean]

local checkbox = loveframes.Create("checkbox")
checkbox:SetText("Checkbox")
checkbox:SetPos(5, 30)
checkbox.OnChanged = function(object, value)
    print(value)
end

Methods

SetText

Sets the object's text

object:SetText(text[string])

GetText

Gets the object's text

Returns 1 value: text [string]

local text = object:GetText()

SetChecked

Sets whether the object is checked or not

object:SetChecked(checked[boolean])

GetChecked

Gets whether the object is checked or not

Returns 1 value: checked [boolean]

local checked = object:GetChecked()

SetFont

Sets the object's font

object:SetFont(font[font])

GetFont

Gets the object's font

Returns 1 value: font [font]

local font = object:GetFont()

GetBoxSize

Gets the object's box size

Returns 2 values: boxwidth [number], boxheight [number]

local boxwidth, boxheight = checkbox:GetBoxSize()

GetBoxWidth

Gets the object's box width

Returns 1 value: boxwidth [number]

local boxwidth = checkbox:GetBoxWidth()

GetBoxHeight

Gets the object's box height

Returns 1 value: boxheight [number]

local boxheight = checkbox:GetBoxHeight()

SetEnabled

Enables or disables the object

object:SetEnabled(enabled[bool])

GetEnabled

Gets whether or not the object is enabled

Returns 1 value: enabled [bool]

local enabled = object:GetEnabled()