Lua Class - guiFrame

Extends guiBase

guiFrame is a class in the Teverse Lua API that contains 14 properties, 0 methods and 0 events. guiFrame extends guiBase.

CODE SAMPLE
--The values set in this constructor are random and may not work correctly.
local guiFrame = teverse.construct("guiFrame", {
    active = true,
    backgroundAlpha = 1.0,
    backgroundColour = colour.rgb(255, 255, 255),
    clip = true,
    dropShadowAlpha = 1.0,
    dropShadowBlur = 1.0,
    dropShadowColour = colour.rgb(255, 255, 255),
    dropShadowOffset = vector2(10, 10),
    name = "",
    parent = guiBase,
    position = guiCoord(0.0, 10, 0.0, 10),
    rotation = 1.0,
    size = guiCoord(0.0, 10, 0.0, 10),
    strokeAlpha = 1.0,
    strokeColour = colour.rgb(255, 255, 255),
    strokeRadius = 1.0,
    strokeWidth = 1.0,
    visible = true,
    zIndex = 1.0
})
Properties
READONLY
vector2 absolutePosition

Absolute position in pixels from the top left of the screen

CODE SAMPLE
print(guiFrame.absolutePosition) --> vector2(10, 10)
READONLY
vector2 absoluteSize

Absolute size in pixels

CODE SAMPLE
print(guiFrame.absoluteSize) --> vector2(10, 10)
number backgroundAlpha

An alpha value of 1.0 is completely visible, 0.0 is invisible.

CODE SAMPLE
guiFrame.backgroundAlpha = 1.0
print(guiFrame.backgroundAlpha) --> 1.0
colour backgroundColour

CODE SAMPLE
guiFrame.backgroundColour = colour.rgb(255, 255, 255)
print(guiFrame.backgroundColour) --> colour.rgb(255, 255, 255)
number dropShadowAlpha

CODE SAMPLE
guiFrame.dropShadowAlpha = 1.0
print(guiFrame.dropShadowAlpha) --> 1.0
number dropShadowBlur

CODE SAMPLE
guiFrame.dropShadowBlur = 1.0
print(guiFrame.dropShadowBlur) --> 1.0
colour dropShadowColour

CODE SAMPLE
guiFrame.dropShadowColour = colour.rgb(255, 255, 255)
print(guiFrame.dropShadowColour) --> colour.rgb(255, 255, 255)
vector2 dropShadowOffset

CODE SAMPLE
guiFrame.dropShadowOffset = vector2(10, 10)
print(guiFrame.dropShadowOffset) --> vector2(10, 10)
guiCoord position

Position relative to the parent element

CODE SAMPLE
guiFrame.position = guiCoord(0.0, 10, 0.0, 10)
print(guiFrame.position) --> guiCoord(0.0, 10, 0.0, 10)
guiCoord size

Size relative to the parent element

CODE SAMPLE
guiFrame.size = guiCoord(0.0, 10, 0.0, 10)
print(guiFrame.size) --> guiCoord(0.0, 10, 0.0, 10)
number strokeAlpha

CODE SAMPLE
guiFrame.strokeAlpha = 1.0
print(guiFrame.strokeAlpha) --> 1.0
colour strokeColour

CODE SAMPLE
guiFrame.strokeColour = colour.rgb(255, 255, 255)
print(guiFrame.strokeColour) --> colour.rgb(255, 255, 255)
number strokeRadius

CODE SAMPLE
guiFrame.strokeRadius = 1.0
print(guiFrame.strokeRadius) --> 1.0
number strokeWidth

CODE SAMPLE
guiFrame.strokeWidth = 1.0
print(guiFrame.strokeWidth) --> 1.0
INHERITED
boolean active

When true, this element can capture the mouse's hover

CODE SAMPLE
guiFrame.active = true
print(guiFrame.active) --> true
INHERITED READONLY
table children

CODE SAMPLE
print(guiFrame.children) --> {}
INHERITED
boolean clip

When true, children are cropped to fit

CODE SAMPLE
guiFrame.clip = true
print(guiFrame.clip) --> true
INHERITED READONLY
number id

CODE SAMPLE
print(guiFrame.id) --> 1.0
INHERITED
string name

CODE SAMPLE
guiFrame.name = ""
print(guiFrame.name) --> ""
INHERITED
guiBase parent

Parent of a guiBase must be another gui element

CODE SAMPLE
guiFrame.parent = guiBase
print(guiFrame.parent) --> guiBase
INHERITED
number rotation

CODE SAMPLE
guiFrame.rotation = 1.0
print(guiFrame.rotation) --> 1.0
INHERITED
boolean visible

CODE SAMPLE
guiFrame.visible = true
print(guiFrame.visible) --> true
INHERITED
number zIndex

Increasing the zIndex will render this element above others. Currently a signed 16 bit integer.

CODE SAMPLE
guiFrame.zIndex = 1.0
print(guiFrame.zIndex) --> 1.0
Methods
INHERITED
guiBase child( string name )
CODE SAMPLE
guiFrame:child("") --> guiBase

Returns nil if not found

INHERITED
destroy( )
CODE SAMPLE
guiFrame:destroy() --> 

Destroys this object, further accessing this instance will error

INHERITED
destroyChildren( )
CODE SAMPLE
guiFrame:destroyChildren() --> 

Destroys all children

Events
INHERITED
:on("changed", function( string property, variant oldValue, variant newValue ) end)

Fired when a property is changed.

guiFrame:on("changed", function(property, oldValue, newValue)
  print(property) --> ""  print(oldValue) --> variant  print(newValue) --> variant
end)
INHERITED
:on("childAdded", function( guiBase newChild ) end)

Triggered when the viewport size is changed

guiFrame:on("childAdded", function(newChild)
  print(newChild) --> guiBase
end)
INHERITED
:on("childRemoved", function( guiBase newChild ) end)

Triggered when a child is added

guiFrame:on("childRemoved", function(newChild)
  print(newChild) --> guiBase
end)
INHERITED
:on("destroying", function( guiBase newChild ) end)

Triggered when the object is destroyed

guiFrame:on("destroying", function(newChild)
  print(newChild) --> guiBase
end)
INHERITED
:on("fingerDown", function( vector2 fingerPosition ) end)

finger down

guiFrame:on("fingerDown", function(fingerPosition)
  print(fingerPosition) --> vector2(10, 10)
end)
INHERITED
:on("fingerUp", function( vector2 fingerPosition ) end)

finger up

guiFrame:on("fingerUp", function(fingerPosition)
  print(fingerPosition) --> vector2(10, 10)
end)
INHERITED
:on("mouseEnter", function( ) end)

Mouse is hovering over this element

guiFrame:on("mouseEnter", function()

end)
INHERITED
:on("mouseExit", function( ) end)

Mouse is no longer hovering

guiFrame:on("mouseExit", function()

end)
INHERITED
:on("mouseLeftDown", function( vector2 mousePosition ) end)

Left mouse button down

guiFrame:on("mouseLeftDown", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
INHERITED
:on("mouseLeftUp", function( vector2 mousePosition ) end)

Left mouse button up

guiFrame:on("mouseLeftUp", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
INHERITED
:on("mouseMiddleDown", function( vector2 mousePosition ) end)

Middle mouse button down

guiFrame:on("mouseMiddleDown", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
INHERITED
:on("mouseMiddleUp", function( vector2 mousePosition ) end)

Middle mouse button up

guiFrame:on("mouseMiddleUp", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
INHERITED
:on("mouseRightDown", function( vector2 mousePosition ) end)

Right mouse button down

guiFrame:on("mouseRightDown", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
INHERITED
:on("mouseRightUp", function( vector2 mousePosition ) end)

Right mouse button up

guiFrame:on("mouseRightUp", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
INHERITED
:on("mouseWheel", function( vector2 wheelMovement ) end)

Mouse wheeled

guiFrame:on("mouseWheel", function(wheelMovement)
  print(wheelMovement) --> vector2(10, 10)
end)

Some sections of our docs are maintained on github.