Skip to main content

Window

Window

Usage​

Client/Index.lua
local window = EGUI.Window(10, 10, 400, 400, "Window Test", true, true)

Constructor Parameters​

TypeNameDefault
numberposX
numberposY
numberwidth
numberheight
stringtitle
booleantitlebarEnabledtrue
booleancloseButtonEnabledtrue
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
ReturnsNameDescription
WindowSetTitleSet the title of the window
stringGetTitleGets the title of the window
WindowSetTitelbarEnabledSets whether the titlebar is enabled
booleanIsTitelbarEnabledGets whether the titlebar is enabled
WindowSetCloseButtonEnabledSets whether the close button is enabled
booleanIsCloseButtonEnabledGets whether the close button is enabled
WindowBringToFrontBrings window to the front

SetTitle​

Sets the title of the window

Returns the Window (self)

window:SetTitle("Title")
TypeParameterDefault ValueDescription
stringtitleTitle 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)
TypeParameterDefault ValueDescription
booleanenableTitle 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)
TypeParameterDefault ValueDescription
booleanenableTitle 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​

NameDescription
MoveTriggered when the window is moved
CloseClickTriggered 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)