Lua Class - guiImage

Extends guiFrame

guiImage is a class that contains 5 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 guiImage = teverse.construct("guiImage", {
    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),
    image = "tevurl:img/tTiled.png",
    imageAlpha = 1.0,
    imageBottomRight = vector2(10, 10),
    imageColour = colour.rgb(255, 255, 255),
    imageTopLeft = 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
string image

CODE SAMPLE
guiImage.image = "tevurl:img/tTiled.png"
print(guiImage.image) --> "tevurl:img/tTiled.png"
number imageAlpha

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

CODE SAMPLE
guiImage.imageAlpha = 1.0
print(guiImage.imageAlpha) --> 1.0
vector2 imageBottomRight

Defaults to {1, 1}, the bottom right corner of the image loaded. Decreasing this number leads to cropping, increasing will lead to repetition.

CODE SAMPLE
guiImage.imageBottomRight = vector2(10, 10)
print(guiImage.imageBottomRight) --> vector2(10, 10)
colour imageColour

CODE SAMPLE
guiImage.imageColour = colour.rgb(255, 255, 255)
print(guiImage.imageColour) --> colour.rgb(255, 255, 255)
vector2 imageTopLeft

CODE SAMPLE
guiImage.imageTopLeft = vector2(10, 10)
print(guiImage.imageTopLeft) --> vector2(10, 10)
INHERITED READONLY
vector2 absolutePosition

Absolute position in pixels from the top left of the screen

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

Absolute size in pixels

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

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

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

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

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

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

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

When true, children are cropped to fit

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

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

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

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

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

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

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

Parent of a guiBase must be another gui element

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

Position relative to the parent element

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

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

Size relative to the parent element

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

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

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

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

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

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

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

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

Returns nil if not found

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

Destroys this object, further accessing this instance will error

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

Destroys all children

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

Fired when a property is changed.

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

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

Triggered when a child is added

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

Triggered when the object is destroyed

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

finger down

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

finger up

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

Mouse is hovering over this element

guiImage:on("mouseEnter", function()

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

Mouse is no longer hovering

guiImage:on("mouseExit", function()

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

Left mouse button down

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

Left mouse button up

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

Middle mouse button down

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

Middle mouse button up

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

Right mouse button down

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

Right mouse button up

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

Mouse wheeled

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

Some sections of our docs are maintained on github.