Back

CreateText

Hello World
Content:
- Methods

Creates a text label which is used to display texts in your game.

txt = gfx.CreateText( text, fontSize, fontFile, align, callback ) → game object: Text

Methods

The following methods are available on the Text object:

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