A 2D texture that can be displayed on screen.

Constructor

@:value({ fontSize : 32, fieldWidth : 0 })new(x:Int, y:Int, text:String, fieldWidth:Int = 0, fontSize:Int = 32)

Variables

@:value(Rl.Colors.WHITE)color:Color = Rl.Colors.WHITE

Color of the text.

@:value(0)fieldWidth:Int = 0

@:value(32)fontSize:Int = 32

@:value("")text:String = ""

Methods

center(?axies:Axies):Void

Automatically centers the text on the screen

Parameters:

axies

the axies to center the sprite on. Takes either X, Y, or XY. If left empty, XY is used.

draw():Void

Used to draw the text on every frame, only override this if you know what you're doing!

unload():Void

Used to unload and free all allocated resources, it is not recommended to override this, Called automatically upon scene switch or when un-registering the sprite.

update():Void

Used to update internal variables upon every frame. called automatically.

Inherited Variables

Defined by RgObject

pos:Rect

Position and scaling of the object.

Inherited Methods