Lua Class - guiRichTextBox

Extends guiTextBox

guiRichTextBox is a class that contains 1 properties, 3 methods and 0 events. This class extends guiTextBox.

CODE SAMPLE
--The values set in this constructor are random and may not work correctly.
local guiRichTextBox = teverse.construct("guiRichTextBox", {
    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,
    text = "",
    textAlign = enums.align,
    textAlpha = 1.0,
    textColour = colour.rgb(255, 255, 255),
    textEditable = true,
    textFont = "",
    textMultiline = true,
    textShadowColour = colour.rgb(255, 255, 255),
    textShadowSize = 1.0,
    textSize = 1.0,
    textWrap = true,
    visible = true,
    zIndex = 1.0
})
Properties
READONLY
table colours

Returns a table of {index, colour} (e.g: {{1, colour(1,0,0)}, {3, colour(0,1,0)}})

CODE SAMPLE
print(guiRichTextBox.colours) --> {}
INHERITED READONLY
vector2 absolutePosition

Absolute position in pixels from the top left of the screen

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

Absolute size in pixels

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

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

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

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

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

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

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

When true, children are cropped to fit

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

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

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

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

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

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

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

Parent of a guiBase must be another gui element

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

Position relative to the parent element

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

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

Size relative to the parent element

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

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

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

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

CODE SAMPLE
guiRichTextBox.strokeWidth = 1.0
print(guiRichTextBox.strokeWidth) --> 1.0
INHERITED
string text

The text rendered

CODE SAMPLE
guiRichTextBox.text = ""
print(guiRichTextBox.text) --> ""
INHERITED
enums.align textAlign

Determines the rendered text is aligned

CODE SAMPLE
guiRichTextBox.textAlign = enums.align
print(guiRichTextBox.textAlign) --> enums.align
INHERITED
number textAlpha

0.0 makes the text fully transparent and invisible.

CODE SAMPLE
guiRichTextBox.textAlpha = 1.0
print(guiRichTextBox.textAlpha) --> 1.0
INHERITED
colour textColour

Colour of the text rendered

CODE SAMPLE
guiRichTextBox.textColour = colour.rgb(255, 255, 255)
print(guiRichTextBox.textColour) --> colour.rgb(255, 255, 255)
INHERITED READONLY
string textDimensions

Gets the bounds of the text

CODE SAMPLE
print(guiRichTextBox.textDimensions) --> ""
INHERITED
boolean textEditable

When true, the user can input into this box

CODE SAMPLE
guiRichTextBox.textEditable = true
print(guiRichTextBox.textEditable) --> true
INHERITED
string textFont

Determines the rendered text's font

CODE SAMPLE
guiRichTextBox.textFont = ""
print(guiRichTextBox.textFont) --> ""
INHERITED
boolean textMultiline

When true, user can input newline characters.

CODE SAMPLE
guiRichTextBox.textMultiline = true
print(guiRichTextBox.textMultiline) --> true
INHERITED
colour textShadowColour

The text shadow colour, rendered as a blurred backing.

CODE SAMPLE
guiRichTextBox.textShadowColour = colour.rgb(255, 255, 255)
print(guiRichTextBox.textShadowColour) --> colour.rgb(255, 255, 255)
INHERITED
number textShadowSize

When 0, no shadow is rendered. Increasing this value will determine how much the shadow spreads.

CODE SAMPLE
guiRichTextBox.textShadowSize = 1.0
print(guiRichTextBox.textShadowSize) --> 1.0
INHERITED
number textSize

Size of the text rendered

CODE SAMPLE
guiRichTextBox.textSize = 1.0
print(guiRichTextBox.textSize) --> 1.0
INHERITED
boolean textWrap

When true, text wraps onto a new line with new line characters.

CODE SAMPLE
guiRichTextBox.textWrap = true
print(guiRichTextBox.textWrap) --> true
INHERITED
boolean visible

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

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

CODE SAMPLE
guiRichTextBox.zIndex = 1.0
print(guiRichTextBox.zIndex) --> 1.0
Methods
clearColours( )

Removes any set colours at all indexes

CODE SAMPLE
guiRichTextBox:clearColours() --> 
removeColour( int index )

Removes any set colour at the index provided

CODE SAMPLE
guiRichTextBox:removeColour(int) --> 
setColour( int index , colour colour )

Sets the colour of text onwards from the provided index

CODE SAMPLE
guiRichTextBox:setColour(int, colour.rgb(255, 255, 255)) --> 
INHERITED
guiBase child( string name )
CODE SAMPLE
guiRichTextBox:child("") --> guiBase

Returns nil if not found

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

Destroys this object, further accessing this instance will error

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

Destroys all children

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

Fired when a property is changed.

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

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

Triggered when a child is added

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

Triggered when the object is destroyed

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

finger down

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

finger up

guiRichTextBox:on("fingerUp", function(fingerPosition)
  print(fingerPosition) --> vector2(10, 10)
end)
INHERITED
:on("keyDown", function( enums.keysym keyCode ) end)

Key pressed

guiRichTextBox:on("keyDown", function(keyCode)
  print(keyCode) --> enums.keysym
end)
INHERITED
:on("keyUp", function( enums.keysym keyCode ) end)

Key released

guiRichTextBox:on("keyUp", function(keyCode)
  print(keyCode) --> enums.keysym
end)
INHERITED
:on("mouseEnter", function( ) end)

Mouse is hovering over this element

guiRichTextBox:on("mouseEnter", function()

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

Mouse is no longer hovering

guiRichTextBox:on("mouseExit", function()

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

Left mouse button down

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

Left mouse button up

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

Middle mouse button down

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

Middle mouse button up

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

Right mouse button down

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

Right mouse button up

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

Mouse wheeled

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

Some sections of our docs are maintained on github.