Skip to main content

Checkbox

Checkbox

Usage​

Client/Index.lua
local checkbox = EGUI.Checkbox(10, 10, 200, 30, "Checkbox Test")

Constructor Parameters​

TypeNameDefault
numberposX
numberposY
numberwidth
numberheight
stringtext
tableparentnil

Functions​

Inherited Element Functions
ReturnsNameDescription
Base ElementSetVisibleSets element visibility
booleanIsVisibleReturns if element is visible
Base ElementSetAlphaSets element alpha
numberGetAlphaReturns element alpha
Base ElementSetPositionSets element position
number, numberGetPositionReturns element position
Base ElementSetSizeSets element size
number, numberGetSizeReturns element size
Base ElementSetAlignmentSets element alignment
stringGetAlignmentGets element alignment
SubscribeSubscribes to an event
UnsubscribeUnsubscribes from a event
Inherited Input Functions
ReturnsNameDescription
Base InputSetEnabledAllows enabling/disabling of the input
booleanIsEnabledWhether the input is enabled
ReturnsNameDescription
CheckboxSetCheckedSets whether the checkbox is checked
booleanIsCheckedGets whether the checkbox is checked
CheckboxSetTextSets the text of the checkbox
stringGetTextGets the text of the checkbox

SetChecked​

Sets the state of the checkbox

Returns the Checkbox (self)

checkbox:SetChecked(false)
TypeParameterDefault ValueDescription
booleanstateThe new state

IsChecked​

Gets whether the checkbox is checked

Returns a boolean

local checked = checkbox:IsChecked()

SetText​

Sets the text of the checkbox

Returns the Checkbox (self)

checkbox:SetText("Text")

GetText​

Gets the text of the checkbox

Returns a string

local text = checkbox:GetText()

Events​

NameDescription
ChangeTriggered when the value of the checkbox changed
FocusInTriggered when the checkbox receives the focus
FocusOutTriggered when the checkbox looses the focus

Change​

Triggered when the value of the checkbox changed

checkbox:Subscribe("Change", function(checked)

end)

FocusIn​

Triggered when the checkbox receives the focus

checkbox:Subscribe("FocusIn", function()

end)

FocusOut​

Triggered when the checkbox looses the focus

checkbox:Subscribe("FocusOut", function()

end)