Skip to main content

TextArea

TextArea

Usage​

Client/Index.lua
local textArea = EGUI.TextArea(10, 10, 100, 100)

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
TextAreaSetValueSets value of the text area
stringGetValueGets value of the text area
TextAreaSetPlaceholderSets placeholder of the text area
stringGetPlaceholderGets placeholder of the text area
TextAreaSetMaxLengthSets max length of the text area
numberGetMaxLengthGets max length of the text area

SetValue​

Sets the value of the text area

Returns the TextArea (self)

textArea:SetValue("Value")
TypeParameterDefault ValueDescription
stringvalueThe new value

GetValue​

Gets the value of the text area

Returns a string of the current value

local value = textArea:GetValue()

SetPlaceholder​

Sets the placeholder of the text area

Returns the TextArea (self)

textArea:SetPlaceholder("Placeholder")
TypeParameterDefault ValueDescription
stringplaceholderThe new placeholder

GetPlaceholder​

Gets the placeholder of the text area

Returns a string

local placeholder = textArea:GetPlaceholder()

SetMaxLength​

Sets the max length of the text area value

Returns the TextArea (self)

textArea:SetMaxLength(30)
TypeParameterDefault ValueDescription
numbermaxLengthThe max length of the text area value

GetMaxLength​

Gets the max length of the text area value

Returns a number

local maxLength = textArea:GetMaxLength()

Events​

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

Change​

Triggered when the value of the text area changed

textArea:Subscribe("Change", function(value)

end)

FocusIn​

Triggered when the text area receives the focus

textArea:Subscribe("FocusIn", function()

end)

FocusOut​

Triggered when the text area looses the focus

textArea:Subscribe("FocusOut", function()

end)