Skip to main content

Button

Window

Usage​

Client/Index.lua
local button = EGUI.Button(10, 10, 200, 30, "Button 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
ButtonSetTextSets the text
stringGetTextGets the text
ButtonSetStyleSets the style
Button StyleGetStyleGets the style
ButtonSetColorSets the color
ColorGetColorGets the color

SetText​

Sets the text of the button

Returns the Button (self)

button:SetText("Text")
TypeParameterDefault ValueDescription
stringtextThe new text

GetText​

Gets the text of the button

Returns a string

local text = button:GetText()

SetStyle​

Sets the style of the button

Returns the Button (self)

button:SetStyle(EGUI.Button.Styles.Rounded)
TypeParameterDefault ValueDescription
Button StylestyleThe new button style

GetStyle​

Gets the style of the button

Returns a string Button Style

local style = button:GetStyle()

SetColor​

Sets the color of the button

Returns the Button (self)

button:SetColor(EGUI.Color.Secondary)
TypeParameterDefault ValueDescription
ColorcolorThe new button color

GetColor​

Gets the color of the button

Returns a string Color

local color = button:GetColor()

Events​

NameDescription
LeftClickTriggered when the button is left clicked

LeftClick​

Triggered when the button is left clicked

button:Subscribe("LeftClick", function()

end)