new Font(filename)
Load a '.FNT' file for GRX.
Parameters:
| Name | Type | Description |
|---|---|---|
filename |
* | name of the font file. |
Members
-
static filename
-
Name of the FNT file.
-
static height
-
Font height
Methods
-
DrawStringCenter(x, y, text, foreground, background)
-
Draw a center aligned string to the canvas.
Parameters:
Name Type Description xnumber x position ynumber y position. textstring the string to draw. foregroundColor foreground color. backgroundColor background color. -
DrawStringLeft(x, y, text, foreground, background)
-
Draw a left aligned string to the canvas.
Parameters:
Name Type Description xnumber x position ynumber y position. textstring the string to draw. foregroundColor foreground color. backgroundColor background color. -
DrawStringRight(x, y, text, foreground, background)
-
Draw a right aligned string to the canvas.
Parameters:
Name Type Description xnumber x position ynumber y position. textstring the string to draw. foregroundColor foreground color. backgroundColor background color. -
StringHeight(text) → {number}
-
Calculate string height for this font.
Parameters:
Name Type Description textstring the string to check. Returns:
number - the height in pixels. -
StringWidth(text) → {number}
-
Calculate string width for this font.
Parameters:
Name Type Description textstring the string to check. Returns:
number - the width in pixels.