Input
Usage​
Client/Index.lua
local input = EGUI.Input(10, 10, 200, 30)
Constructor Parameters​
Type | Name | Default |
---|---|---|
number | posX | |
number | posY | |
number | width | |
number | height | |
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 |
---|---|---|
Input | SetValue | Sets the value of the input |
string | GetValue | Gets the value of the input |
Input | SetType | Sets the input type |
Input Type | GetType | Gets the input type |
Input | SetPlaceholder | Sets the placeholder |
string | GetPlaceholder | Gets the placeholder |
Input | SetMaxLength | Sets the max length |
number | GetMaxLength | Gets the max length |
SetValue​
Sets the value of the input
Returns the
Input
(self)
input:SetValue("Value")
Type | Parameter | Default Value | Description |
---|---|---|---|
string | value | The new value |
GetValue​
Gets the value of the input
Returns a
string
of the current value
local value = input:GetValue()
SetType​
Sets the type of the input
Returns the
Input
(self)
input:SetType(EGUI.Input.Types.Password)
Type | Parameter | Default Value | Description |
---|---|---|---|
Input Type | type | The new input type |
GetType​
Gets the type of the input
Returns a string
Input Type
local type = input:GetType()
SetPlaceholder​
Sets the placeholder of the input
Returns the
Input
(self)
input:SetPlaceholder("Placeholder")
Type | Parameter | Default Value | Description |
---|---|---|---|
string | placeholder | The new placeholder |
GetPlaceholder​
Gets the placeholder of the input
Returns a
string
local placeholder = input:GetPlaceholder()
SetMaxLength​
Sets the max length of the input value
Returns the
Input
(self)
input:SetMaxLength(30)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | maxLength | The max length of the input value |
GetMaxLength​
Gets the max length of the input value
Returns a
number
local maxLength = input:GetMaxLength()
Events​
Name | Description |
---|---|
Change | Triggered when the value of the input changed |
FocusIn | Triggered when the input receives the focus |
FocusOut | Triggered when the input looses the focus |
Change​
Triggered when the value of the input changed
input:Subscribe("Change", function(value)
end)
FocusIn​
Triggered when the input receives the focus
input:Subscribe("FocusIn", function()
end)
FocusOut​
Triggered when the input looses the focus
input:Subscribe("FocusOut", function()
end)