Button
Usage​
Client/Index.lua
local button = EGUI.Button(10, 10, 200, 30, "Button 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 |
---|---|---|
Button | SetText | Sets the text |
string | GetText | Gets the text |
Button | SetStyle | Sets the style |
Button Style | GetStyle | Gets the style |
Button | SetColor | Sets the color |
Color | GetColor | Gets the color |
SetText​
Sets the text of the button
Returns the
Button
(self)
button:SetText("Text")
Type | Parameter | Default Value | Description |
---|---|---|---|
string | text | The 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)
Type | Parameter | Default Value | Description |
---|---|---|---|
Button Style | style | The 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)
Type | Parameter | Default Value | Description |
---|---|---|---|
Color | color | The new button color |
GetColor​
Gets the color of the button
Returns a string
Color
local color = button:GetColor()
Events​
Name | Description |
---|---|
LeftClick | Triggered when the button is left clicked |
LeftClick​
Triggered when the button is left clicked
button:Subscribe("LeftClick", function()
end)