Skip to main content

Input

Input

Usage​

Client/Index.lua
local input = EGUI.Input(10, 10, 200, 30)

Constructor Parameters​

TypeNameDefault
numberposX
numberposY
numberwidth
numberheight
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
InputSetValueSets the value of the input
stringGetValueGets the value of the input
InputSetTypeSets the input type
Input TypeGetTypeGets the input type
InputSetPlaceholderSets the placeholder
stringGetPlaceholderGets the placeholder
InputSetMaxLengthSets the max length
numberGetMaxLengthGets the max length

SetValue​

Sets the value of the input

Returns the Input (self)

input:SetValue("Value")
TypeParameterDefault ValueDescription
stringvalueThe 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)
TypeParameterDefault ValueDescription
Input TypetypeThe 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")
TypeParameterDefault ValueDescription
stringplaceholderThe 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)
TypeParameterDefault ValueDescription
numbermaxLengthThe max length of the input value

GetMaxLength​

Gets the max length of the input value

Returns a number

local maxLength = input:GetMaxLength()

Events​

NameDescription
ChangeTriggered when the value of the input changed
FocusInTriggered when the input receives the focus
FocusOutTriggered 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)