Base 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 |
SetVisible​
Sets the visibility of the element
Returns the
Base Element
(self)
element:SetVisible(false)
Type | Parameter | Default Value | Description |
---|---|---|---|
boolean | visible | Whether its visible |
IsVisible​
Returns
boolean
whether its visible
if element:IsVisible() then
Package.Log("Element is visible")
else
Package.Log("Element is invisible")
end
SetAlpha​
Sets element alpha
Returns the
Base Element
(self)
element:SetAlpha(0.5)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | alpha | Alpha value between 0 and 1 |
GetAlpha​
Gets current element alpha
Returns the current alpha as a
number
between 0 and 1
local alpha = element:GetAlpha()
SetPosition​
Sets element position
Returns the
Base Element
(self)
element:SetPosition(50, 50)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | posX | X position of the element | |
number | posY | Y position of the element |
GetPosition​
Gets element position
Returns two
number
values (posX, posY)
local posX, posY = element:GetPosition()
SetSize​
Sets element size
Returns the
Base Element
(self)
element:SetSize(50, 50)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | width | width of the element | |
number | height | height of the element |
GetSize​
Gets element size
Returns two
number
values (width, height)
local width, height = element:GetSize()
SetAlignment​
Sets element alignment
Returns the
Base Element
(self)
element:SetAlignment(EGUI.Alignment.BottomLeft)
Type | Parameter | Default Value | Description |
---|---|---|---|
Alignment | alignment | alignment of the element |
GetAlignment​
Gets element alignment
Returns
string
of the alignemnt
local alignment = element:GetAlignment()
Subscribe​
Subscribes to an event
Type | Parameter | Default Value | Description |
---|---|---|---|
string | event | Name of the event | |
function | handler | Function which handles the event |
Unsubscribe​
Unsubscribes from a event
If handler is
nil
then all handlers for this event will be unsubscribed.
Type | Parameter | Default Value | Description |
---|---|---|---|
string | event | Name of the event | |
function | handler | nil | Function which handles the event |