Lua API  0.4.0
Game Engine
 All Files Functions
Texts.lua File Reference

Functions

 setText (object, text)
 Changes the string displayed by a text object. More...
 
 getText (object)
 Retrieves the string displayed by a text object. More...
 
 getTextColor (object)
 Retrieves the color displayed by a text object. More...
 
 setTextColor (object, color)
 Sets the color displayed by a text object. More...
 

Function Documentation

getText ( object  )

Retrieves the string displayed by a text object.

Parameters
objectThe text object.
Returns
The current string.
getTextColor ( object  )

Retrieves the color displayed by a text object.

Parameters
objectThe text object.
Returns
The current color as a vec4.

Example:

color = getTextColor(object)
print("Color: R = " .. color[1] .. " G = " .. color[2] .. " B = " .. color[3] .. " A = " .. color[4])
setText ( object  ,
text   
)

Changes the string displayed by a text object.

Parameters
objectThe text object.
textThe new string.

Example:

setText(textobject, "Sometext!")
setTextColor ( object  ,
color   
)

Sets the color displayed by a text object.

Parameters
objectThe text object.
colorThe new color as a vec4.

Example:

setTextColor(object, {r,g,b,a})