Checkbox
Usage​
Client/Index.lua
local checkbox = EGUI.Checkbox(10, 10, 200, 30, "Checkbox Test")
Constructor Parameters​
Type | Name | Default |
---|---|---|
number | posX | |
number | posY | |
number | width | |
number | height | |
string | text | |
table | parent | nil |
Functions​
Inherited Element Functions
Returns | Name | Description |
---|---|---|
Base Element | SetVisible | Sets element visibility |
boolean | IsVisible | Returns if element is visible |
Base Element | SetAlpha | Sets element alpha |
number | GetAlpha | Returns element alpha |
Base Element | SetPosition | Sets element position |
number , number | GetPosition | Returns element position |
Base Element | SetSize | Sets element size |
number , number | GetSize | Returns element size |
Base Element | SetAlignment | Sets element alignment |
string | GetAlignment | Gets element alignment |
Subscribe | Subscribes to an event | |
Unsubscribe | Unsubscribes from a event |
Inherited Input Functions
Returns | Name | Description |
---|---|---|
Base Input | SetEnabled | Allows enabling/disabling of the input |
boolean | IsEnabled | Whether the input is enabled |
Returns | Name | Description |
---|---|---|
Checkbox | SetChecked | Sets whether the checkbox is checked |
boolean | IsChecked | Gets whether the checkbox is checked |
Checkbox | SetText | Sets the text of the checkbox |
string | GetText | Gets the text of the checkbox |
SetChecked​
Sets the state of the checkbox
Returns the
Checkbox
(self)
checkbox:SetChecked(false)
Type | Parameter | Default Value | Description |
---|---|---|---|
boolean | state | The 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​
Name | Description |
---|---|
Change | Triggered when the value of the checkbox changed |
FocusIn | Triggered when the checkbox receives the focus |
FocusOut | Triggered 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)