Window
Usage​
Client/Index.lua
local window = EGUI.Window(10, 10, 400, 400, "Window Test", true, true)
Constructor Parameters​
Type | Name | Default |
---|---|---|
number | posX | |
number | posY | |
number | width | |
number | height | |
string | title | |
boolean | titlebarEnabled | true |
boolean | closeButtonEnabled | true |
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 |
Returns | Name | Description |
---|---|---|
Window | SetTitle | Set the title of the window |
string | GetTitle | Gets the title of the window |
Window | SetTitelbarEnabled | Sets whether the titlebar is enabled |
boolean | IsTitelbarEnabled | Gets whether the titlebar is enabled |
Window | SetCloseButtonEnabled | Sets whether the close button is enabled |
boolean | IsCloseButtonEnabled | Gets whether the close button is enabled |
Window | BringToFront | Brings window to the front |
SetTitle​
Sets the title of the window
Returns the Window (self)
window:SetTitle("Title")
Type | Parameter | Default Value | Description |
---|---|---|---|
string | title | Title of the window |
GetTitle​
Gets the title of the window
local title = window:GetTitle()
SetTitelbarEnabled​
info
The titelbar allows dragging of the window. The title bar requires an additional 30 pixels!
Sets whether the titlebar is enabled
Returns the
Window
(self)
window:SetTitelbarEnabled(false)
Type | Parameter | Default Value | Description |
---|---|---|---|
boolean | enable | Title of the window |
IsTitelbarEnabled​
Gets whether the titlebar is enabled
Returns
boolean
whether its enabled
local enabled = window:IsTitelbarEnabled()
SetCloseButtonEnabled​
info
The close button can only be shown if the titelbar is enabled.
Sets whether the close button is enabled
Returns the
Window
(self)
window:SetTitelbarEnabled(false)
Type | Parameter | Default Value | Description |
---|---|---|---|
boolean | enable | Title of the window |
IsCloseButtonEnabled​
Gets whether the close button is enabled
Returns
boolean
whether its enabled
local enabled = window:IsCloseButtonEnabled()
BringToFront​
Brings window to the front
Returns the
Window
(self)
window:BringToFront()
Events​
Name | Description |
---|---|
Move | Triggered when the window is moved |
CloseClick | Triggered when the close button is clicked |
Move​
Triggered when the window is moved
window:Subscribe("Move", function(posX, posY)
end)
CloseClick​
Triggered when the close button is clicked
window:Subscribe("CloseClick", function()
end)