TextFormat

public class
loom2d.display.TextFormat

Description

Describe the format of some text for the Graphics class. Pass to Graphics.textFormat() to specify the active format.

API overview

Constructor

TextFormat ( font: String = null , size: Number = , color: Number = , bold: Object = null )
Describe a font format by specifying font name, indicating size, color, and if it's bolded

Attributes

Public attributes

align: Number

Align as specified in TextAlign

color: Number

RGB color of the text

font: String

What font should we use with this text format? The name is one previously passed to TextFormat.load()

letterSpacing: Number

Add additional spacing between letters

lineHeight: Number

Add additional space between lines (in pixels)

size: Number

Size of text in pixels

Functions

Public functions

load ( fontName: String , filePath: String ): Void static native

Load a TTF font from a given path and register it under the specified name

Constructor

TextFormat ( font: String = null , size: Number = , color: Number = , bold: Object = null )

Describe a font format by specifying font name, indicating size, color, and if it's bolded. If you don't specify a property, it remains unspecified and doesn't alter render state when the format is passed via textFormat().

Attributes

align: Number

Align as specified in TextAlign.

color: Number

RGB color of the text.

font: String

What font should we use with this text format? The name is one previously passed to TextFormat.load().

letterSpacing: Number

Add additional spacing between letters.

lineHeight: Number

Add additional space between lines (in pixels).

size: Number

Size of text in pixels.

Functions

getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

load ( fontName: String , filePath: String ): Void

static native

Load a TTF font from a given path and register it under the specified name.

Parameters

fontName: String
filePath: String


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

: