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:

alignString: “left” or “center” or “right”
alphaNumber: fraction (0..1)
angleNumber: fraction (0..1)
Contains( x, y ) → Boolean
fileString: path to file or folder ( “/absolute/...” or “relative/...” )
fontSizeNumber: pixel
heightNumber: fraction (0..1)
pivotXNumber: fraction (0..1)
pivotYNumber: fraction (0..1)
scaleXNumber: factor
scaleYNumber: factor
Update()
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