Lua Class - guiIcon

Extends guiFrame

guiIcon is a class that contains 7 properties, 0 methods and 0 events. This class extends guiFrame.

CODE SAMPLE
--The values set in this constructor are random and may not work correctly.
local guiIcon = teverse.construct("guiIcon", {
    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),
    iconAlpha = 1.0,
    iconColour = colour.rgb(255, 255, 255),
    iconId = "coins",
    iconMax = 1.0,
    iconType = "faSolid",
    name = "",
    parent = guiBase,
    position = guiCoord(0.0, 10, 0.0, 10),
    rotation = 1.0,
    shadowColour = colour.rgb(255, 255, 255),
    shadowSize = 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
number iconAlpha

CODE SAMPLE
guiIcon.iconAlpha = 1.0
print(guiIcon.iconAlpha) --> 1.0
colour iconColour

CODE SAMPLE
guiIcon.iconColour = colour.rgb(255, 255, 255)
print(guiIcon.iconColour) --> colour.rgb(255, 255, 255)
string iconId

CODE SAMPLE
guiIcon.iconId = "coins"
print(guiIcon.iconId) --> "coins"
number iconMax

CODE SAMPLE
guiIcon.iconMax = 1.0
print(guiIcon.iconMax) --> 1.0
enums.iconType iconType

CODE SAMPLE
guiIcon.iconType = "faSolid"
print(guiIcon.iconType) --> "faSolid"
colour shadowColour

CODE SAMPLE
guiIcon.shadowColour = colour.rgb(255, 255, 255)
print(guiIcon.shadowColour) --> colour.rgb(255, 255, 255)
number shadowSize

CODE SAMPLE
guiIcon.shadowSize = 1.0
print(guiIcon.shadowSize) --> 1.0
INHERITED READONLY
vector2 absolutePosition

Absolute position in pixels from the top left of the screen

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

Absolute size in pixels

CODE SAMPLE
print(guiIcon.absoluteSize) --> vector2(10, 10)
INHERITED
boolean active

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

CODE SAMPLE
guiIcon.active = true
print(guiIcon.active) --> true
INHERITED
number backgroundAlpha

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

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

CODE SAMPLE
guiIcon.backgroundColour = colour.rgb(255, 255, 255)
print(guiIcon.backgroundColour) --> colour.rgb(255, 255, 255)
INHERITED READONLY
table children

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

When true, children are cropped to fit

CODE SAMPLE
guiIcon.clip = true
print(guiIcon.clip) --> true
INHERITED
number dropShadowAlpha

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

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

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

CODE SAMPLE
guiIcon.dropShadowOffset = vector2(10, 10)
print(guiIcon.dropShadowOffset) --> vector2(10, 10)
INHERITED READONLY
number id

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

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

Parent of a guiBase must be another gui element

CODE SAMPLE
guiIcon.parent = guiBase
print(guiIcon.parent) --> guiBase
INHERITED
guiCoord position

Position relative to the parent element

CODE SAMPLE
guiIcon.position = guiCoord(0.0, 10, 0.0, 10)
print(guiIcon.position) --> guiCoord(0.0, 10, 0.0, 10)
INHERITED
number rotation

CODE SAMPLE
guiIcon.rotation = 1.0
print(guiIcon.rotation) --> 1.0
INHERITED
guiCoord size

Size relative to the parent element

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

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

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

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

CODE SAMPLE
guiIcon.strokeWidth = 1.0
print(guiIcon.strokeWidth) --> 1.0
INHERITED
boolean visible

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

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

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

Returns nil if not found

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

Destroys this object, further accessing this instance will error

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

Destroys all children

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

Fired when a property is changed.

guiIcon: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

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

Triggered when a child is added

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

Triggered when the object is destroyed

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

finger down

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

finger up

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

Mouse is hovering over this element

guiIcon:on("mouseEnter", function()

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

Mouse is no longer hovering

guiIcon:on("mouseExit", function()

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

Left mouse button down

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

Left mouse button up

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

Middle mouse button down

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

Middle mouse button up

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

Right mouse button down

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

Right mouse button up

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

Mouse wheeled

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

Some sections of our docs are maintained on github.