Lua Class - guiBase

Extends objectBase

guiBase is a class that contains 7 properties, 2 methods and 15 events. This class extends objectBase.

This class cannot be constructed, it is managed by Teverse.

Properties
boolean active

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

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

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

When true, children are cropped to fit

CODE SAMPLE
guiBase.clip = true
print(guiBase.clip) --> true
guiBase parent

Parent of a guiBase must be another gui element

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

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

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

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

CODE SAMPLE
guiBase.zIndex = 1.0
print(guiBase.zIndex) --> 1.0
INHERITED READONLY
number id

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

CODE SAMPLE
guiBase.name = ""
print(guiBase.name) --> ""
Methods
guiBase child( string name )

Returns nil if not found

CODE SAMPLE
guiBase:child("") --> guiBase
destroyChildren( )

Destroys all children

CODE SAMPLE
guiBase:destroyChildren() --> 
INHERITED
destroy( )
CODE SAMPLE
guiBase:destroy() --> 

Destroys this object, further accessing this instance will error

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

Fired when a property is changed.

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

Triggered when the viewport size is changed

CODE SAMPLE
guiBase:on("childAdded", function(newChild)
  print(newChild) --> guiBase
end)
:on("childRemoved", function( guiBase newChild ) end)

Triggered when a child is added

CODE SAMPLE
guiBase:on("childRemoved", function(newChild)
  print(newChild) --> guiBase
end)
:on("destroying", function( guiBase newChild ) end)

Triggered when the object is destroyed

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

finger down

CODE SAMPLE
guiBase:on("fingerDown", function(fingerPosition)
  print(fingerPosition) --> vector2(10, 10)
end)
:on("fingerUp", function( vector2 fingerPosition ) end)

finger up

CODE SAMPLE
guiBase:on("fingerUp", function(fingerPosition)
  print(fingerPosition) --> vector2(10, 10)
end)
:on("mouseEnter", function( ) end)

Mouse is hovering over this element

CODE SAMPLE
guiBase:on("mouseEnter", function()

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

Mouse is no longer hovering

CODE SAMPLE
guiBase:on("mouseExit", function()

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

Left mouse button down

CODE SAMPLE
guiBase:on("mouseLeftDown", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
:on("mouseLeftUp", function( vector2 mousePosition ) end)

Left mouse button up

CODE SAMPLE
guiBase:on("mouseLeftUp", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
:on("mouseMiddleDown", function( vector2 mousePosition ) end)

Middle mouse button down

CODE SAMPLE
guiBase:on("mouseMiddleDown", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
:on("mouseMiddleUp", function( vector2 mousePosition ) end)

Middle mouse button up

CODE SAMPLE
guiBase:on("mouseMiddleUp", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
:on("mouseRightDown", function( vector2 mousePosition ) end)

Right mouse button down

CODE SAMPLE
guiBase:on("mouseRightDown", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
:on("mouseRightUp", function( vector2 mousePosition ) end)

Right mouse button up

CODE SAMPLE
guiBase:on("mouseRightUp", function(mousePosition)
  print(mousePosition) --> vector2(10, 10)
end)
:on("mouseWheel", function( vector2 wheelMovement ) end)

Mouse wheeled

CODE SAMPLE
guiBase:on("mouseWheel", function(wheelMovement)
  print(wheelMovement) --> vector2(10, 10)
end)

Some sections of our docs are maintained on github.