Creates a text label which is used to display texts in your game.
Properties
The following properties are available on the Text object:
align →
String: “left” or
“center” or
“right”
alpha →
Number: fraction (0..1)
angle →
Number: fraction (0..1)
file →
String: path to file or folder ( “/absolute/...” or “relative/...” )
height →
Number: fraction (0..1)
pivotX →
Number: fraction (0..1)
pivotY →
Number: fraction (0..1)
Methods
The following methods are available on the Text object:
Number
String
Number: fraction (0..1)
String: path to file ( “/absolute/...” or “relative/...” )
String: “left” or “center” or “right”
Object: Matrix
function()
txt.align
Alignment for multiline text. does not affect single line text.
txt.alpha
The objects alpha value
txt.angle
The rotation fraction of the object
txt.Contains
Checks if a point is contained in the sprite
txt.file
Path to the source file.
txt.fontSize
text font size in pixels
txt.height
The height of the object
txt.pivotX
The x pivot for rotations
txt.pivotY
The y pivot for rotations
txt.scaleX
The horizontal scaling
txt.scaleY
The vertical scaling
txt.SetMatrix
Set the individual 2d transformation
txt.Update
Updates internal properties
txt.visible
Indicates the objects visibility state
txt.width
The obects width